Rainbows are formed when sunlight passes through water droplets in the atmosphere and is refracted, or bent, at a particular angle. As light passes through the droplets, each wavelength of light is bent at a slightly different angle, causing the light to separate into its component colors. When the light reflects off the back of the droplet, the colors come together and form a rainbow.