Why Is the Sky Blue?
Sunlight is every color at once, so why does the sky pick blue? The answer is a trick of size and scattering.
Sunlight looks white, but it is a mix of every color of the rainbow, each one a different wavelength of light. Red light has long, lazy waves. Blue and violet light have short, tight ones.
When sunlight enters the atmosphere, it runs into nitrogen and oxygen molecules that are far smaller than the wavelength of visible light. Tiny particles like these scatter short wavelengths much more strongly than long ones. The effect is called Rayleigh scattering, after the British physicist Lord Rayleigh, who worked out the math in the 1870s. Scattering rises sharply as wavelength shrinks, so blue light is scattered several times more than red.
That scattered blue light bounces around the sky and reaches your eyes from every direction. Look anywhere away from the sun and you are seeing sunlight that has been knocked sideways by air, and most of what gets knocked sideways is blue.
If shorter waves scatter most, why is the sky not violet? Three reasons work together. The sun puts out less violet than blue in the first place. Some violet is absorbed high in the atmosphere. And human eyes are much more sensitive to blue than to violet, so the mix we receive reads as sky blue.
The same physics explains sunsets. When the sun is low, its light has to cross far more air to reach you. By the time it arrives, most of the blue has been scattered out of the beam along the way, leaving the reds and oranges that travel straight through. Dust and smoke can make the effect even stronger, which is why sunsets after wildfires or volcanic eruptions can look so dramatic.
Clouds follow a different rule. Their water droplets are much larger than air molecules, and large particles scatter all colors about equally. Equal parts of every color add up to white, which is why clouds look white, or gray when they are thick enough to block light from above.
On Mars the story flips. Fine red dust fills its thin atmosphere, so the daytime sky looks butterscotch, and its sunsets glow blue. Same sun, different air.