If the Sun is shining while there are a lot of water droplets in the sky, the droplets refract, reflect, and disperse the white light of the Sun into its various component colors. The result is a rainbow. In some rare instances, fog rather than rain can produce a rainbow; the water particles in the fog are so small that the rainbow appears white.

