"In answering this question, it is helpful to start with a description of the path followed by the rays that form the rainbow. As can be seen in this diagram, a ray of light from the sun enters one side of a water drop, gets refracted as it enters, reflects internally off the other side of the drop, and emerges again from the other side, again with refraction. We can consider rays of light from the distant sun to be parallel.
"If you trace a large number of parallel rays that strike a drop of water at various points on the drop, you will discover that a concentration of rays emerges at one specific angle, 42 degrees from the angle at which the light entered. So we have a picture of parallel rays coming from the sun, striking a lot of raindrops, and then being reflected and refracted back from the drops--but not straight back, rather at an angle of 42 degrees.
"Now comes the crucial question: where in the sky do you look to see the light returning from the raindrops? Let us start by defining a direction in space: a direction exactly opposite the sun, called the antisolar point. If you are standing outside during the daytime, the antisolar point is marked by the shadow of your head. To see the light coming back from the raindrops, look 42 degrees away from that antisolar point. Of course, the region of the sky 42 degrees away from that point is not just one direction but a whole collection of directions, one that forms a circle around the antisolar point.
"So, to summarize, look to the antisolar point, and then shift your gaze to 42 degrees away--you are now looking at the rainbow. Rainbows will always appear at that same angle from the antisolar point. The height of the rainbow, however, will depend on how high the sun is above the horizon.
"And what about the colors of the rainbow? Each color of the spectrum gets refracted by a different amount when it passes from air to water or from water to air, the same as happens when light passes through a prism. Consequently, the rainbow circle is not 42 degrees for all colors. The circle is smaller for blue rays than it is for red rays, so the primary rainbow is blue on the inside and red on the outside, with the intermediate colors of the spectrum spread out in between.
"It is also possible for some of the light rays entering the drop to undergo not one but two internal reflections before they emerge. If you look at a whole collection of such rays, you see a concentration of light coming back at an angle of 51 degrees. These rays produce a secondary rainbow, also centered on the antisolar point, having an angular radius of 51 degrees; the secondary rainbow therefore appears outside of the primary bow. The sequence of colors is reversed in the secondary bow.
"More information about rainbows and other atmospheric optical phenomena can be found in my book 'Rainbows, Halos and Glories' (Cambridge University Press, 1990).