The True View
Veteran observers pointed out, however, that the green flash could not be an afterimage because it had been seen many times at sunrise, when the green appears before the red of the Sun. And by the middle of the 20th century, photographs finally verified once and for all that it was physical, not physiological. How then does the atmosphere produce this marvel? There are two optical effects at work: refraction and dispersion.
Sunlight bends or refracts as it travels through denser layers of our atmosphere. Cooler (and denser) air over hot ground will produce a false image of the sky a mirage, as shown in the top panel. Refraction also lifts the Sun when it’s low above the horizon (lower panel), as sunlight passes through much more atmosphere than when it’s overhead.
Sky & Telescope
When light enters Earth’s atmosphere it is refracted, or bent, in the direction of the denser air in other words, downward. The amazing result of such refraction makes the image of any celestial object we see appear slightly higher than the true position it would occupy if Earth had no air. The effect is greatest at the horizon, where light takes the longest pathway possible through the atmosphere.
The typical amount of atmospheric refraction at the horizon is about ½° the apparent diameter of the Sun or full Moon. This means that when we see the Sun’s bottom edge touch the horizon, the Sun’s top edge has really just gone below the horizon! What we see is the refracted image of the Sun displaced upward by one diameter.
But refraction is just part of the story. Have you ever seen a rainbow or used a glass prism to spread sunlight into its spectrum of colors? This occurs because sunlight is composed of a range of wavelengths (colors), each of which is refracted by a different amount. The shorter (bluer) the wavelength, the more it’s refracted by the atmosphere.
Air can act just like a prism to spread sunlight into its component colors. The degree to which light beams refract depends on their color (wavelength). Refraction is strongest when the Sun lies low above the horizon, creating a blue-green fringe on the top edge of its disk.
Sky & Telescope
So the Sun’s normal white or yellow-white image is really composed of disks of different colors at ever-so-slightly different heights in the sky: the blue-light Sun sits a bit higher than the green-light Sun and so on, with each spectrum color until the red-light Sun, which is lowest. This dispersion of wavelengths is small enough, however, that the Suns of different colors overlap and produce white except at the bottom and top of the Sun’s disk. The very bottom edge is red; the very top edge is blue.