Stand with the sun at your back and look at the shadow of your head. That spot is the antisolar point, the point in the sky exactly opposite the sun. Every rainbow you have ever seen was a piece of a circle drawn around it. The bright red edge sits about 42° away from that point, wherever you stand.
This is why a rainbow never gets closer as you walk towards it. It isn't an object at a place. It is a direction: all the raindrops that happen to lie 42° from your shadow send coloured light to your eye. Move, and a different set of drops does the job. The person next to you sees their own rainbow, made by other drops.
The question is why 42°, and why only there. The answer is inside a single drop.
A sunbeam hitting a spherical raindrop bends as it enters, because light slows down in water. Some of it reflects off the back of the drop, and it bends again on the way out. It leaves heading roughly back towards the sun, but tilted by an angle that depends on where it hit the drop.
A ray that hits the drop dead centre goes straight in, bounces straight back and returns along its own path: 0° from the antisolar point. Rays that hit further off-centre come back at larger angles. But not indefinitely. Past a certain point the angle stops growing and turns back down. For water that maximum is about 42°.
That turning point is the key. Near a maximum a curve is flat, so a wide range of entry points all send light out at almost the same angle. In a simple ray count, about a fifth of all the rays hitting a drop leave within one degree of the maximum. Light piles up at the edge. That pile-up is the rainbow. Everything inside the circle gets some scattered light too, which is why the sky inside a rainbow looks brighter than the sky outside.
Below is one raindrop with sunlight coming from the left. Slide the entry point to move a ray from the centre of the drop to its edge. The chart underneath plots the exit angle for every possible entry point.
Things to try:
Water bends violet light slightly more than red. That small difference, called dispersion, shifts the turning point. Red light piles up at about 42.4° from the antisolar point, violet at about 40.6°. The whole coloured band is less than two degrees wide, about three and a half times the width of the full moon.
So the drops sending you red are the ones 42° out from your shadow, and the drops sending you violet sit a little closer in. Red forms the outer ring, violet the inner ring, and the other colours fall in between. Each drop sends out every colour, but at your eye it only contributes one, depending on where it sits in the sky.
René Descartes worked out the 42° geometry in 1637 by tracing rays through a model drop. Isaac Newton later added the colours, by showing that each colour bends by a slightly different amount.
Some light bounces twice inside the drop before it escapes. The same flattening happens, but now the angle has a minimum instead of a maximum, around 50° to 53°. That makes a second, fainter rainbow outside the first. The extra reflection turns the path over, so the colours come out reversed: red on the inside, violet on the outside. It is dimmer because some light escapes at every reflection.
Look at the chart again. Once-reflected light can only reach you from within about 42° of your shadow. Twice-reflected light can only reach you from beyond about 50°. Between them lies a strip of sky where no drop can send you reflected sunlight at all. That strip looks noticeably darker than the sky on either side. It is called Alexander's dark band, after Alexander of Aphrodisias, who described it around AD 200.
The full rainbow is always a circle, but the ground cuts it off. Its centre is your shadow, which is below the horizon whenever the sun is up. The higher the sun, the lower the circle sinks. Once the sun is more than about 42° above the horizon, the main bow has sunk out of sight entirely. That is why rainbows are an early-morning and late-afternoon thing, and why the tallest arcs come just after sunrise or just before sunset.
Lift the viewpoint and more of the circle appears. From a plane, a tall building or a garden hose on a sunny day, you can sometimes see the whole ring, with the shadow of your head sitting exactly in the middle.