It is caused by a phenomenon called refraction. White light from the sun is made up of lots of individual colours (frequencies). When white light passes through water drops in the air, these different frequencies are bent by different amounts, which causes the beam of white light to split up into its individual components. It’s these individual colours that spread out causing a rainbow to appear in the sky.
Yes again James got the right answer in before me. It’s pretty cool that white light is actually just a mix of all the colours of the rainbow. If you’ve ever seen a prism work it’s the same effect, a band called Pink Floyd had a famous album cover showing a prism doing this.
Yup, the guys have already covered it. You can also get lots of different types of rainbow depending on light conditions. You can get a double rainbow from a double reflection in the raindrop, and because the light has been bounced twice, the colours are in a different order.