Rainbows are raindrops and sunlight interacting in the perfect way. Just like a prism, light hits a drop of water and forms brilliant colors. White light enters a raindrop which has a different density than the surrounding air. Due to the changes in density, raindrop density compared to the density of air, the speed of the light changes. The change in speed causes the light to bend (angle of refraction). The light bends as it enters the raindrop (refraction) and then reflects off the back of the raindrop. When the light leaves the raindrop, the light speeds up and bends again (refraction). It is the two refractions, that are not parallel, that cause the light to break up into a spectrum of colors.
The original angle of the light entering the raindrop.
The angle of the light exiting the raindrop that is headed directly to you. It is your "line of sight" with the raindrop that determines what you see!
The difference of these angles (angle of deviation) depends on if you see a rainbow. When the difference between the angles is 40°-42°, the light bright enough to form a visible rainbow. Blue light is refracted at 40° and red light is refracted at 42°. The result is red being at the top of the rainbow and blue being at the bottom. The other colors are refracted between the angles of 40° and 42°. Every light that you see is formed by a different raindrop refracting a different color depending on your line of sight.
Part of the beauty of rainbows is that what you see, is from your specific angle. Because what you see is the result of the original angle (pre raindrop) and your line of sight (post raindrop) everyone sees a slightly different rainbow.
Rainbows appear when your back is to the sun and there are suspended spheres of water in front of you. The sphere of water can be the result of many things besides rain. Sprinklers, mist from ocean waves or a fountain and waterfalls can all help in the creation of a rainbow.
What you see, a circular arc, is only half of the rainbow. The rainbow continues as a full circle but your view on the ground is disrupted by the horizon. From high above the ground (in an airplane for example) you could see the full circle of the rainbow.