Imagine standing on a beach, a mountaintop or any open area, watching a beautiful sunset. As the sun sets, it appears redder and redder as it gets closer to the horizon. Sometimes you can see a gradation of color a across the surface of the sun. Why does this happen?

If you saw a sunset on the moon, our local star, the sun, would look white. That’s because the moon doesn’t have an atmosphere.

But, unlike the moon, Earth does have an atmosphere. And most of us know that white light – like sunlight – is composed of all the colors of the rainbow. Tiny molecules in our atmosphere cause light to scatter. That’s why our sky looks blue: it’s because the atmosphere scatters the bluish component of white sunlight. And it’s why the sun looks reddish when it’s near the horizon.

No matter where you are on Earth, as you look toward a horizon, you're looking through more atmosphere than when you look overhead. Image via The Bad Astronomer

Think about what happens as the sun sinks lower in the sky. Its light has to travel farther and farther through the atmosphere before reaching your eyes, simply because there’s more atmosphere in the direction toward the horizon than overhead.

Sunlight encounters more air molecules when the sun is low in the sky than when the sun is overhead. Even more blue light is scattered away, leaving mostly the reddish component of white sunlight to travel the straighter path to your eyes. So the setting sun looks red.

Bottom line: The red color of a sunset is due to the fact that, when we look toward any horizon, we’re looking through more of Earth’s atmosphere than when we look overhead.