Rainbows are caused by the light of the sun refracting through the water droplets in the air.
(From an encyclopedia)
An arc showing the colors of the spectrum, violet inside and red outside, which appears when the sun shines through water droplets. It often appears while the sun is shining after a brief thundershower in the late afternoon or on fog layers. The sun, the observer's eye, and the center of the arc must be aligned–the rainbow appears in the part of the sky opposite the sun. The rainbow is an arc of 180° if the sun is at the horizon, and it cannot appear if the sun is high in the sky. It is caused by the refraction and reflection of rays from the sun on a "sheet" of water droplets. The light is refracted as it enters the sphere of the individual water drop, then is reflected from the drop's opposite side, and is again refracted as it leaves the drop and passes to the observer's eye. When conditions are suitable, a double rainbow may be seen; a larger, paler, secondary rainbow with colors reversed (red inside) outside the primary arc is caused by two refractions and two reflections of the ray while it is inside a drop. The "rainbows" of mist, lawn spray, and spray from a waterfall are similarly caused. The lunary rainbow, seen much less often, is usually observable soon after dark following a brief summer storm or shower when the moon is nearly full. Aristotle was first to devote serious attention to the rainbow, but his mistaken explanation of it misled thinkers for centuries. Descartes in the 17th cent. also attempted to account for the phenomenon but the correct explanation of it could not be furnished until the physics of light and its reflection and refraction were understood and the spectrum explained. In religion and art the rainbow symbolizes God's promise of mercy to mankind after the Deluge (Gen. 9.13). The Greeks and Romans called the rainbow the sign of Iris, messenger of the gods. The Inca and other Native Americans regarded the rainbow as a gift from the sun-god. There are fairy tales of searches for the pot of gold at the foot of the rainbow.
See R. Greenler, Rainbows, Halos, and Glories (1990).
I hope that will explain it enough for you!
Many years of reading about science & the world around us.