When water droplets in the air come in contact with the light from the sun, the reflection of light is refracted in the water droplet and shows the color spectrum we know as the rainbow.