This study was based on the hypothesis that the speed of propagation of photons inside a transparent substance depends on the density of electron clouds of atoms of this substance. In the process of research, based on the relativistic formula of Einstein, a new dispersion formula was obtained, which can be applied to the widest range of transparent substances. 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. The successful application of the relativistic formula to the 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.