Few sights stop people in their tracks like a rainbow arcing across the sky after a shower. It looks almost magical, a ribbon of pure colour suspended in the air. Yet behind that beauty lies a precise and rather elegant piece of physics, one that has been understood since the work of Isaac Newton and others centuries ago. A rainbow is sunlight, rain and geometry working together.

What a rainbow is

A rainbow is an optical effect, a band of colours produced when sunlight is bent, split and reflected by raindrops in the air. It is not a physical object and has no fixed position in the sky. Instead, it is a pattern of light that reaches your eyes from millions of individual raindrops, each bouncing sunlight to you at just the right angle.

The key idea, which surprises many people, is that ordinary white sunlight is not really white at all. It is a mixture of all the colours of the spectrum blended together. A rainbow is simply nature pulling that mixture apart so we can see its hidden components.

The science of bending light

To understand rainbows you need two ideas: refraction and dispersion.

  • Refraction is the bending of light when it passes from one material into another, such as from air into water. Light slows down slightly in water, and this change of speed causes its path to bend.
  • Dispersion is the splitting of white light into its colours. Different colours of light travel at slightly different speeds in water, so they bend by slightly different amounts. Red light bends the least, violet the most.

You can see the same effect with a glass prism, which spreads a beam of sunlight into a spectrum. In a rainbow, each raindrop acts as a tiny prism. This is the same physics of light and colour that explains how the human eye works, where cone cells in the retina interpret different wavelengths as different colours.

What happens inside a raindrop

The full journey of light through a single raindrop has three stages:

  1. Light enters the drop and refracts, bending and beginning to spread into its colours.
  2. It reflects off the inside of the back of the drop, bouncing back towards the front.
  3. It exits the drop and refracts again, spreading the colours further apart.

By the time the light leaves, the white sunlight has been fanned out into a small spread of colours. Crucially, this happens most strongly at a particular angle, around 42 degrees relative to the direction of the incoming sunlight. Every drop that sits at this angle from your line of sight sends a particular colour to your eye, and together millions of drops build the full arc.

Because each colour emerges at a slightly different angle, you see red coming from drops slightly higher in the sky and violet from drops slightly lower, which is why the colours form an ordered band rather than a muddle.

Why the colours never change order

A rainbow's colours always run in the same sequence: red on the outside, then orange, yellow, green, blue and violet on the inside. This order is fixed by physics. Because red light always bends the least and violet the most, red always ends up on the outer edge of the bow and violet on the inner edge.

The traditional list of seven colours, often remembered as the name "Roy G. Biv", is really a human convention; the spectrum is a smooth, continuous blend with no sharp boundaries between one colour and the next. The number of distinct colours we name is a quirk of language and perception, not a feature of the light itself.

Why a rainbow always faces away from the Sun

To see a rainbow, three conditions must line up:

  • The Sun must be behind you.
  • There must be rain, mist or spray in front of you.
  • The Sun must be fairly low in the sky, which is why rainbows are common in the morning and late afternoon.

This is why you so often see rainbows when a shower is clearing and the Sun breaks through behind you. It also explains why the centre of a rainbow's arc is always directly opposite the Sun, at the point astronomers call the antisolar point. The link between the Sun's position in the sky and what we observe on the ground is part of the same celestial geometry that drives what causes the seasons.

Double rainbows and other variations

Sometimes a fainter, second rainbow appears above the main one. This double rainbow occurs when light reflects twice inside the raindrops rather than once. The extra reflection reverses the colour order, so the outer bow runs from violet on the outside to red on the inside, the mirror image of the primary bow. The band of slightly darker sky between the two is known as Alexander's band.

You do not even need rain to see a rainbow. The spray from a waterfall, a garden hose or sea mist can produce one, because all that is required is sunlight and water droplets. You can even make your own on a sunny day by standing with the Sun behind you and spraying a fine mist of water in front of you.

Why you can never reach the end

The old story of a pot of gold at the end of the rainbow is safe from treasure hunters, because a rainbow has no end and no fixed location. It is created entirely by the angle between the Sun, the raindrops and your own eyes. As you move, different raindrops come into the right position, so the rainbow moves with you. Two people standing side by side are technically seeing slightly different rainbows, each formed by different drops. Walk towards it and it simply recedes, forever out of reach.

The bottom line

A rainbow forms when sunlight enters raindrops, bends through refraction, reflects off the back of each drop, and bends again on the way out, splitting white light into its component colours through dispersion. The colours always run from red on the outside to violet on the inside, set by the fixed way each colour bends in water. You see one only with the Sun behind you and rain ahead, at an angle of about 42 degrees. And because it is an effect of light and geometry rather than a solid thing, a rainbow has no end you could ever reach, only a beauty you can pause to admire.