Why is there sometimes a green flash at sunset and sunrise?

On a clear day, sometimes a green flash appears with the sun on the horizon just after sunset or before sunrise. But why does this happen?

A photograph of a sunset over the ocean with a green flash around the sun.
A short burst of green light can appear as the sun sets over the ocean, a phenomenon called the "green flash."
(Image credit: David McManus via Shutterstock)

As the sun dips below the horizon and the light starts to dim, lucky observers may spot a rare, brief flash of emerald. This is the "green flash," which can sometimes be seen right after sunset or before sunrise. 

So what causes the green flash?

Alice Sun
Live Science Contributor

Alice Sun is a science journalist based in Brooklyn. She covers a wide range of topics, including ecology, neuroscience, social science and technology. Her work has appeared in Audubon, Sierra, Inverse and more. For her bachelor's degree, she studied environmental biology at McGill University in Canada. She also has a master's degree in science, health and environmental reporting from NYU.