The Atmosphere Prism
The Earth's atmosphere acts like a giant, gentle prism. As the sun sinks toward the horizon, its light has to travel through more air, which bends the light. This bending separates the sunlight into different colors, with the red light at the bottom and the green and blue light at the very top.
The Final Glimmer
As the sun disappears, the red, orange, and yellow layers vanish below the horizon first. For a tiny fraction of a second, the very top edge of the sun is still visible. This top edge is the green and blue part of the light spectrum.
Why Green and Not Blue?
Since blue light is at the very top of the spectrum, you might expect a 'blue flash.' However, our atmosphere is very good at scattering blue light away (which is why the sky is blue!). By the time the sun is setting, most of the blue has been scattered, leaving green as the survivor.
