It is, even sober observers agree, quite astonishing for its purity of color. At sunrise, the same phenomenon occurs before the sun's disk makes its appearance over the horizon. The earth's atmosphere is refractive, bending visual images so that when the sun is at the horizon, it is actually about a half-degree lower than it appears to be. As the sun nears the horizon, the atmosphere works like a prism, dividing the light into a series of colors, with red the lowest, then yellow, green and blue. Scattering in the atmosphere mostly affects blue light.
Absorption affects yellow.
Under the right conditions, the red image of the sun slips from view. Meanwhile, the atmosphere soaks up the yellow image and scatters the blue image. That leaves only the green image, which can appear as a flash of light. Between 1902 and 1905, a Dutch ship captain named Egbertus Havinga observed some 300 green flashes. An astronomer working at Whipple Observatory on Mt. Hopkins in Arizona recently reported that he sees the green flash on 90 percent of the nights when there are no clouds to obscure the sunset.