Ever seen a rare green streak of light near the horizon right around sunrise or sunset? These "green flashes" are beautiful indeed, and the reason they sometimes form is very interesting.
To understand why this is so rare, we have to start with our atmosphere.
It acts as a sort of a "prism," splitting light into the visible spectrum. It explains our blue sky and why the sun is yellow when it is high in the sky.
But, at sunset, our sun's light is traveling through much more of the atmosphere, which means more of the colors are scattered, with blues scattering the most and reds the least. This explains why the main colors you see at sunsets are reds and oranges.
As the sun drops to the horizon, the red light begins to disappear. Since the blue is already scattered, all that is left reaching your eye is that brief flash of green.
Note that it is very hard to actually see this. You need a clear day and a distant horizon with a defined edge. When the sky isn't clear, the increase in particles in the atmosphere scatters the green light.
Many people don't actually view the sunset with a far enough horizon to actually see it. Your best chance to see a green flash is over the ocean, where there are no trees, hills and buildings to impede this rare sight.