Rainbows form when water in the air reflects and refracts sunlight and disperses the normally white sunlight into colored light. White light is composed of colored light that bends at different angles when reflected and refracted, separating the white light into the distinct colors of a rainbow.
Rainbows are white light dispersed into its spectrum of colors. Rainbows become visible after sunlight and water drops experience a series of actions. First, light refracts when it touches the surface of a water drop. Next, light reflects off the back of a water drop, and lastly, light refracts again as it leaves. These refractions and reflections happen at varying angles that allow different colors to appear.
Dispersion causes the colors of a rainbow to appear in a specific pattern due to unique wavelengths for each color. Blue light has a shorter wavelength than red light and refracts at a greater angle, but dispersion due to the reflection step of the process makes blue light appear at a smaller angle than red. This happens for each color and is why rainbows are colored red, orange, yellow, green, blue, indigo and violet from top to bottom. Rainbows can form full circles, but viewers generally only see the above ground arc.