This is a stock ‘Ask the physicist’ question and most physicists think they know the answer. Actually, they only know half the story.
The usual response is “Rayleigh Scattering”. On further probing they will remember, or look up, a formula like
for the intensity of light scattered at an angle θ by molecules of polarisability α a distance R away.

The key point to this formula is that the intensity is proportional to the inverse 4th power of the wavelength. Light’s oscillating electric field pushes all the electrons in a molecule one way and all the nuclei the other, so the molecule (presumably Nitrogen or Oxygen in the stratosphere) responds like any simple harmonic oscillator to a forced oscillation well below its resonant frequency. These oscillating charges act as secondary radiators of EM waves, and higher frequencies radiate more. Visible light varies in frequency by about a factor of 2 over the spectrum (actually a bit less but 2 will do – we speak of the `octave’ of visible EM radiation) so violet light is scattered 16 times as much as red light. So when we look at the sky we see light from the sun that’s been scattered by molecules, and it’s dominated by higher frequency / short wavelengths so it has a blue colour – not completely violet as there is still some longer wavelength light presen
This also explains why light from the sun at sunset (and sunrise), which travels a long way through the atmosphere to get to us, appears redder, having lost its short wavelength component to provide a blue sky for those living to the west (or east) of where we are. It also predicts and explains the polarisation of the scattered blue light: there are dramatic effects to be seen with a pair of polarised sunglasses, but this post’s quite long enough without going into details of them.
Most explanations stop there. This is just as well, because a bit more thought reveals problems. Why don’t light rays show this behaviour at ground level? Why don’t they scatter in solids and liquids, in glass and water? There are many more molecules to do the scattering, after all, but we don’t see any blue light coming out sideways from a light beam going through a glass block or a glass of water.
The reason appears when we consider scattering by several molecules. They are excited by the same EM wave and all start oscillating, the oscillations are secondary sources of EM radiation which could be perceived by an observer – except that they are, in general, out of phase. The light from source to molecule to observer takes different optical paths for each molecule, and when you add them all together they will (apart from statistical variations which are insignificant) sum to zero. To put it another way, when you shine a light beam through a piece of glass and look at it from the side, you perceive different induced dipoles, but half will point up and half will point down, and there is no net effect. The random phase factors only cancel if you look directly along or against the direction of the beam – against the beam the secondary sources combine to give a reflected ray, along the beam their combined effect is out of phase with the original ray and their sum slips in phase – making the light beam slow down.

So we’re stuck. One molecule is not enough to turn the sky blue, you need many. But many molecules co-operate in such a way that there is no side scattering. Dust was once suggested as the reason but dust is only present in exceptional circumstances like after volcano eruptions.
The only way to do it would be if the molecules grouped together in clusters. Clusters small compared to the wavelength of visible photons, but separated by distances large compared to their coherence length. Why would they ever do that?
But they do. Molecules in a gas – unlike those in a solid or liquid – are scattered in random positions and form clusters by sheer statistical variation. This clustering is enhanced by the attractive forces between molecules – the same forces that makes them condense into a liquid at higher pressures / lower temperatures. So the fluctuations in density in the stratosphere are considerable; their size is small and their separation is large, and it’s these fluctuations in molecular density that give us the bright blue sky.

The figure shows (very schematically) how this happens. In the first plot the density is very low and the few molecules are widely separated. In the second the density is higher and even though the distribution shown here is random, clusters emerge due to statistical fluctuations. In the third plot these clusters are enhanced by attraction between the molecules. In the final plot the density is so high they form a solid (or liquid).
This puzzle was not solved by Rayleigh but by – yet again – Albert Einstein. In 1910 he explained (Annalen der Physik 33 1275 (1910)) the size and nature of the density fluctuations in a gas, and showed how the theory explained the phenomenon of critical opalescence, when gases turn milky-white at the critical point, and that the sky was an example of this. It dosn’t even count as one of his ‘great’ papers – though it does follow on from his 1905 annus mirabilis paper on Brownian motion. He showed that our blue sky comes from light scattering not just off molecules, but off fluctuations in the molecular density.
So if anyone ever asks you why the sky is blue, be sure to give them the full story.
Well explained 😊
LikeLike
The molecules in the air are randomly spaced. As such they act as incoherent oscillators with random phases between them. The net results of this is not cancellation. The intensities sum.
LikeLike
No. Random phases cancel, if you have enough of them. To put it another way, the intensities are too small. You need some spatial structure to give local coherence. According to your argument there should be lots of scattering from liquids, in which the molecules are also random, and this is not observed.
LikeLike