A rainbow occurs when sunlight is refracted, or bent, as it passes through raindrops in the air. The sunlight is then reflected off the inside surface of the raindrop and refracted again as it exits the raindrop. This process causes the sunlight to separate into its component colors, creating the beautiful arc of colors that we see in a rainbow. The size and brightness of a rainbow depend on the size of the raindrops and the angle of the sunlight.