The main prerequisite for creating a new dispersion formula was the external similarity of such physical processes as the refraction of light in a transparent substance and the deflection of light by the gravitational field of massive cosmic bodies. Based on the external similarity, a hypothesis was put forward about the internal similarity of these two physical processes. This made it possible to apply Einstein's relativistic formula to the process of light propagation in electron clouds (fields) of transparent substances. As a result, on the basis of this well-known formula, a dispersion formula with a wide range of action was obtained. The new physical formula was used to calculate 26 refractive indices of light in 5 transparent substances in three states of aggregation. Comparison of the obtained indicators with laboratory indicators showed the high accuracy of the new dispersion formula, which amounted to ±10 -7−10 -5 in the calculated wavelength ranges of more than 100 nm. In addition to obtaining a new exact dispersion formula, the successful application of the relativistic formula to processes occurring inside matter at the atomic level allows us to look at the nature of the interaction of light and matter from a new angle.