A collection of suspended water droplets in the atmosphere serves as a refractor of light. The water represents a medium with a different optical density than the surrounding air. Light waves refract when they cross over the boundary from one medium to another. The decrease in speed upon entry of light into a water droplet causes a bending of the path of light towards the normal. And upon exiting the droplet, light speeds up and bends away from the normal. The droplet causes a deviation in the path of light as it enters and exits the drop.
There are countless paths by which light rays from the sun can pass through a drop. Each path is characterized by this bending towards and away from the normal. One path of great significance in the discussion of rainbows is
the path in which light refracts into the droplet, internally reflects, and then refracts out of the droplet. A light ray from the sun enters the droplet with a slight downward trajectory. Upon refracting twice and reflecting once, the light ray is dispersed and bent downward towards an observer on earth's surface. As in the case of the refraction of light through prisms with nonparallel sides, the refraction of light at two boundaries of the droplet results in the dispersion of light into a spectrum of colors. The shorter wavelength blue and violet light refract a slightly greater amount than the longer wavelength red light. Since the boundaries are not parallel to each other, the double refraction results in a distinct separation of the sunlight into its component colors.
Both the primary and secondary rainbows are formed by the reflection and refraction of sunlight in tiny water droplets. When a sunbeam is being refracted twice and reflected once by the droplet, a primary rainbow will form. If the beam is being refracted twice and reflected twice, a secondary rainbow will form. As the secondary rainbow is formed by one more reflection than the primary rainbow, it is much fainter and rare to see. On the other hand, since the paths of sunbeams in a primary rainbow and a secondary rainbow are different, the colors of the secondary rainbow are arranged in just the reverse order of the primary one.