Rainbows happen when sunlight and rain combine in a very specific way. The beams of sunlight separate into the colors we see in the rainbow as they enter a raindrop. Sunlight is actually made up of different colors that we don’t usually see. When a beam of sunlight comes down to Earth, the light is white. But, if the light beam happens to hit raindrops on the way down at a certain angle, the different colors that make up the beam separate so that we can see them — in the form of a rainbow.
The angle for each color of a rainbow is different, because the colors slow down at different speeds when they enter the raindrop. The light exits the raindrop in one color, depending on the angle it came in, so we see only one color coming from each raindrop. Light at different angles coming through many raindrops form the rainbow that we see, in stripes of red, orange, yellow, green, blue, indigo and violet.