Look up on a clear day and the whole sky is blue. Look at the Sun an hour before it sets and it has gone orange-red. Same Sun, same air, and the light has not changed on its way from space. What changed is how much air it had to cross.

Sunlight is every colour at once

Sunlight looks white because it is a mixture of colours, from violet and blue through green to red. Each colour is a wave with its own length: blue is around 450 nanometres, red around 650. A nanometre is a millionth of a millimetre.

When light passes through air, a few waves hit the gas molecules and get knocked sideways. Scientists call this Rayleigh scattering, after Lord Rayleigh, who worked out the rule in the 1870s. The rule is that scattering is inversely proportional to the fourth power of the wavelength.

A fourth power is a big deal

Blue is about 450 nm and red about 650 nm, so red's wave is 1.44 times longer. Raise 1.44 to the fourth power and you get about 4.4. Air scatters blue light roughly four times more strongly than red.

That scattered light does not travel on in a straight line. It is sent in all directions, including down to your eyes from every part of the sky. So the sky you see is mostly the blue that was thrown out of the beam, glowing from all around.

Why not violet?

Violet has an even shorter wavelength, so it scatters even more. The sky is still blue for two reasons. Sunlight contains less violet than blue, and our eyes are less sensitive to violet. Your eyes add up the scattered light and the total lands on a pale sky blue.

Drag the Sun and thicken the air

This is a simplified model with three colours (red, green, blue). It uses the fourth-power rule and a rough clear-air thickness, so treat the colours as illustrative, not exact. Drag the Sun up and down. The bars show how much of each colour of the direct beam survives the trip. Then slide the air thickness to zero to see a world with no atmosphere.

Red0%
Green0%
Blue0%
Drag the Sun (or tap a button). Bars: share of each colour left in the direct sunbeam.

Sunset: the same rule, run backwards

At noon, sunlight crosses the thinnest layer of air it ever will. Near the horizon, the beam skims through the atmosphere at a low angle, and the path through air can be as much as 38 times the overhead path. Every metre of it throws a little more blue out of the beam, then green. By the time the light reaches you, what is left is mostly orange and red.

So the blue has not vanished. It has been scattered away from the beam and into someone else's daytime sky. Try the Sun low in the model and watch the blue bar sink first.

Why the horizon looks pale

Look at the sky near the horizon on a clear day. It is whiter than the blue overhead. Along that long path the light is scattered several times, until red and green are as strong as blue and the mix turns whitish. Very close to the horizon, the air is thick enough to dim the view, so it can darken slightly.

In the model, switch the air to zero and the sky goes black, with a white Sun. That is what astronauts see: a bright Sun against black space, because there are no molecules to throw the light toward their eyes. Make the air thick and hazy and the sky turns pale and milky while the Sun reddens even at midday.

The 30-second version

Air scatters short waves much more than long ones, by a fourth power. Scattered blue lights the whole sky. Sunlight that has to cross lots of air has lost its blue, and what is left is the red of the sunset.