The rainbow effect can be observed whenever there are water drops in the air and sunlight shining from behind the observer at a low altitude or angle. ... The rainbow's appearance is caused by dispersion of sunlight as it is refracted by (approximately spherical) raindrops.
A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water droplets resulting in a spectrum of light appearing in the sky. It takes the form of a multicoloured circular arc. Rainbows caused by sunlight always appear in the section of sky directly opposite the sun.