What you are looking at
A raindrop, magnified until it fills the stage, with sunlight arriving from the left. Shine sunlight in plays seven named stages, ending with a double rainbow over a rainy hillside. Your ray traces a ray of your own, and Sun height moves the Sun.
How are rainbows formed?
Light travels more slowly in water than in air, so a ray entering a raindrop bends towards the normal. Part of it reflects off the back of the drop, crosses the water again and bends a second time on the way out. Water slows violet a little more than red (its refractive index is about 1.343 for violet and 1.331 for red), so violet is bent slightly more whenever it crosses the surface. The colours leave the drop fanned out, a few degrees apart.
The reflection inside is not total internal reflection. The light meets the back of the drop at about 40°, below the critical angle of about 48.6°, so only around 6% reflects and the rest escapes.
Why does the light pile up at 42°?
Rays hit the drop all over its face. A ray through the middle comes straight back towards the Sun; rays further out come back at bigger and bigger angles, until near the edge the angle starts to shrink again. Around the turning point a wide band of rays all leave at almost the same angle, so their light adds up. René Descartes worked this out in 1637, in Les Météores, by tracing rays through a sphere of water. For red light the turning point is at about 42.4°, for violet about 40.6°. Books usually give a single 42° (and 51° for the second bow): those are the figures for yellow light, near the middle of the spectrum, while each real bow is a band a couple of degrees wide.
Why are rainbows curved?
The point directly opposite the Sun, where the shadow of your head points, is called the antisolar point. Any drop about 42° from it sends red light to your eye; a drop a little closer sends violet. All the directions at one angle from a point make a circle, so the bow is a circle centred on the antisolar point. The ground hides the lower part; from an aircraft you can sometimes see the whole ring.
Why is a double rainbow reversed?
Some light reflects twice inside the drop before it leaves. The extra reflection turns it round further, and now violet leaves at the bigger angle: about 53.5°, against about 50° for red. So the secondary bow has red on the inside and violet on the outside. More light escapes at each reflection, which makes it fainter. Between the two bows lies Alexander's dark band, roughly 8° of sky that receives light reflected neither once nor twice.
When can you see a rainbow?
You need the Sun behind you and rain in front. The antisolar point sits as far below the horizon as the Sun is above it, so from flat ground the primary bow vanishes once the Sun is higher than about 42°. That is why rainbows appear in the morning, late afternoon and evening rather than around midday in summer.
In your course
Ray diagrams of refraction are in AQA 4.6.2.2, and the Higher-tier ideas that refraction comes from a change of speed and varies with wavelength are in the same section; reflection at a boundary is 4.6.1.3 (physics only). See our AQA refraction notes. Cambridge IGCSE covers the critical angle and internal reflection in 3.2.2 and dispersion in 3.2.4: see IGCSE refraction of light. Punjab Class 10 Physics covers refraction and the critical angle in section 14.2 (total internal reflection) and dispersion in 14.8 (dispersion of light). The 42° calculation is beyond all three. Split light with the prism and colour simulation, measure angles with Snell's law, and compare another sky effect in why the sky is blue in 3D.