This applet describes The reflection of light in a spherical water drop. This phenomenon is what allows rainbows to form. Rainbows can be described as a distorted reflection of the Sun in water droplets in suspension in the atmosphere.
The reason why the different colors mixed in the incident Sun light are dispersed is that the light is reflected against the back of the drop, so that the light is refracted twice: one time when it enters the drop, a second time when it exits the drop.
Most introductory physics textbook correctly point out that dispersion of light is due to the color dependence of the index of diffraction, but fail to mention that, in this context, the direction of the reflected light also depends on the impact parameter. All colors are actually reflected inside, not on, a cone whose axis is parallel to the incoming light.
Because of the physics of reflection and refraction of light, and because of the geometry involved in the reflection in a sphere, there is a extremum in the variation of the total deflection angle as a function of the impact parameter. It is at this color-dependent angle that light intensity will build up and give rise to rainbows.
The following diagram shows the geometry of reflection in a sphere. Note that angles alpha and beta are related by Snells law, that triangles ABO and BCO are two congruent isosceles triangles, and that the angle between incident and reflected rays is 180 - 2 alpha + 4 beta.
The total deviation is expressed mathematically by:
The extremum of deviation will happen when:
Which can be solved: