Space is black—so why is the sky blue…and the sunset red?
It has to do with the properties of sunlight and Earth’s atmosphere.
Sunlight is made up of many wavelengths of visible light. Combined, we see them as white. But individually they’re a rainbow of colors, from violet and blue to orange and red.
When sunlight enters Earth’s atmosphere, it collides with molecules of oxygen, nitrogen, and other particulates, which scatter the light into different colors.
Violet and blue light have the shortest frequencies and the most energy, so they scatter the most. Much of the violet light is absorbed by the upper atmosphere, but blue light is reflected throughout the atmosphere, giving us a blue sky.
Once near the surface, blue light has been scattered and reflected so much, it recombines with other colors into full-spectrum white light.
When the sun nears the horizon, sunlight passes through much more atmosphere. That longer journey scatters and eventually filters out more of the blue light, leaving the longer-wavelength orange and red light to reach our eyes.
But it’s not this way everywhere. On Mars, the atmosphere is mostly CO2 and filled with iron-rich dust, which scatters the red light, turning the sky there…red.
Except at sunset, when the longer trip through the Martian atmosphere scatters and filters so much red light that blue light passes through—making the sunset…blue!