A rainbow occurs when you have both sunlight and rain. The following is an attempt to explain why you see the colours and where the rainbow is formed in the sky.
Figure 1
shows a ray of light from the Sun being partially internally reflected by a spherical raindrop.
(We will have to ignore the tiny deformation of the drop due to gravitational attraction).
Notice that rainbows are NOT due to total internal
reflection. If they were the light would never be able to escape from the spherical water drop.
The amount of light reflected will vary with the deviation but will be maximum at, or near
minimum deviation.
The path of a ray of light through a spherical raindrop is shown
in Figure 1. (Note that the transmitted light at C has not been shown as it does not contribute
to the rainbow).
To see the rainbow you would need to be facing the area of the sky with the rain in it with your back towards the Sun. (Figure 3).
If you were up in a plane or standing on a mountain it would be possible to see a circular rainbow – the ground would not 'get in the way' of the lower half of the circle. I have seen one of these from a small plane over the South Pacific.
We all see our own rainbow and if we walk around it moves with us. You should be able to see why this is true by looking at Figures 5 and 6.