Physics textbooks have nice color pictures that help to make everything clear. Or do they? Here's a typical explanatory picture of light paths through a drop of water, dispersing the colors seen in the primary rainbow. The skeptical, inquiring mind feels that the explanations aren't complete. Does this explain anything?
After entering the water drop, the light rays reflect once, then refract out of the drop. But, considering that a given color strikes the water surface the second time at the same angle of incidence that it did the first time, why does the diagram show only reflection the first time and only refraction the second time? If this is total internal reflection, why doesn't the light keep reflecting every time it reaches the drop's surface, endlessly, without ever emerging? If this is not total internal reflection at the first surface, then shouldn't some light emerge there, and wouldn't that cause a rainbow seen when looking toward the sun? Inquiring minds want to know.
Answer.The rainbows we see are not formed by light from a single drop of water, but by light from a whole cloud of water drops, emerging in many directions. We see only that light that happens to be directed toward our eyes. The droplets that direct a rainbow's red light to our eyes are not the same ones directing blue light to our eyes.
Total internal reflection plays no role in this, and the reason is interesting. If light impinges into the drop at such an angle that some of it refracts into the drop, then, if reversed, light must also pass out of the drop along the same path. Ray ABCD in Fig. 2 illustrates this. Due to the spherical shape of the water drop, any ray passing internally (along a chord) makes the same angle to the normal at each surface. So any ray entering the drop cannot subsequently ever impinge on the surface at an angle where there's total internal reflection.
The light inside a water drop does continue to reflect internally several times and each time some of it also refracts out of the drop. Two internal reflections give rise to the primary rainbow, with 40° to 42° radius. Three internal reflections give rise to the secondary rainbow with about 51° radius, but beyond that the light intensity refracted out of the drop is quite small. Tertiary rainbows have been reported at 40°20' centered on the sun (seen looking toward the sun).
Some light does refract out of the drop at the point of first internal reflection. So why doesn't it also produce a rainbow seen when looking toward the sun into a cloud of water droplets—as a large arc centered on the sun? Such colorful arcs, called parhelia, are often seen, but these are due to ice crystals in the atmosphere, not to water droplets. Some people call them "rainbows". They have nothing to do with rain, except that they are often seen along with "sun dogs" in high cirrus clouds a day before a rainy weather system arrives.
The light refracted at the point of first internal reflection in a drop does not form a rainbow. The drop acts as a spherical converging lens. Any rays from the very distant sun, refracted through the drop, emerge convergent to form a tiny image of the sun very near the drop itself, and they then diverge. The light from a cloud of such drops mixes into white light, displaying no structure.
This raises the question why the primary rainbow (from the second point of internal reflection) forms a rainbow. Shouldn't the emergent light from the entire cloud of water droplets just merge into an overal whiteness?
Here's where most elementary textbook explanations usually leave us in the dark. We must consider the "impact parameter" of the sunlight rays entering a drop and how the angle of emergence depends on that. If a ray enters the drop headed directly toward the drop's center, it has an impact parameter of zero. If it enters near the edge of the drop its impact parameter is large, nearly equal to the drop's radius. Light enters drops over the whole range of impact parameters.
Consider the emergent angle as a function of impact parameter. The emergent angle is zero when the impact parameter is zero, but as the impact parameter increases, the emergent angle increases, up to about 42°. That is as large as it gets. Further increase of impact parameter decreases the emergent angle. Only near 42° do we see the colors of the rainbow, for the light from other impact parameters blends into white light. The angle of refracted light has a "turning Point" as a function of impact parameter at 42°, called the angle of maximum deviation. Only there do the colors seem distinct. At other angles they overlap and blend into white light. This is the reason why the sky inside the primary bow appears brighter than outside the bow. Not only are the colors reversed for the secondary bow (due to the extra internal reflection), but the sky brigtness effect is reversed also. The geometry of all of this is quite complex and is quite as beautiful as is the rainbow itself.
The angle of refracted light at the first internal reflection point does not display such a "turning point". In this case the deviation angle is a monotonic function of impact parameter. This is another reason it does not form a rainbow.
There are complications due to the fact that raindrops are seldom exactly spherical, but are somewhat flattened by air currents. Remarkably, this fact does not "mess up" the rainbow. Why? Also there are interesting diffraction effects when the water droplets are very small. But this answer is already too long.
More information.The mathematical physics of rainbows and glories. John A. Adam, Physics Reports 356 (2002) p. 229-365.
Rainbow formation. The Physics Classroom.
Greenler, Robert. Rainbows, Halos and Glories.