When Does The Green Flash Phenomenon Occur?
On rare occasions, the final portion of a setting sun appears bright green. This "green flash," as it is known, is due to both refraction (bending) and scattering (reflection in every direction) of sunlight in the atmosphere.
The different color components of sunlight, each having a different wavelength, are refracted to different degrees as sunlight passes through the Earth's atmosphere. Red light, which has the longest wavelength, is bent the least, and violet light, which has the shortest wavelength, is bent the most. In between these two extremes are (from longest to shortest wavelength): orange, yellow, green, blue, and indigo.
As the sun sets over the horizon, yellow, orange, and red (the colors bent the least) are the first wavelengths of light to disappear. However, they are usually the only colors of a setting sun that we see. This is because the colors that are bent the most (blue, indigo, and violet) are scattered by air molecules. Green is the shortest wavelength of sunlight not scattered in this way.
So why aren't green sunsets a regular occurrence? Air pollution. Dust and other particles that are usually present in the air scatter green light. Your best chance to see the green flash is on a boat at sea, where the air is relatively clean and there is a distant, well-defined horizon.
Sources: Weatherwise. December 1996-January 1997, pp. 31-34. Forrester, Frank H. 100/Questions Answered About the Weather, p. 169.