A rainbow is caused by the refraction, dispersion, and reflection of sunlight in raindrops. When sunlight enters a raindrop, it is refracted, or bent, and then dispersed into its individual colors. The light is then internally reflected off the back of the raindrop and refracted again as it exits the drop, creating a rainbow in the sky.