Now a ray of ordinary sunlight is separated into the rays of various colors, which form the solar spectrum when it passes from a medium of one density obliquely to a medium of another density, as when it passes from air to glass, or from air to water, or from outer space into the earth's atmosphere. Under such circumstances its velocity is slowed down when it passes from a rare to a denser medium, and the waves of different wave-lengths are bent from their former course, or refracted, by different amounts. The red rays, of longest wave-length, are bent from their former course the least, and the violet rays, of shortest wave-length, are bent the most upon passing from a rare to a denser medium. As a result the ray of sunlight is spread out or dispersed into its rays of different wave-length and color upon entering a medium of different density. It is this refraction and dispersion of sunlight that produces many color effects in the earth's atmosphere.