30 January 2008
Well to answer this we need to know a few facts about how rainbows are made.
The rainbow's appearance is caused by dispersion of sunlight as it goes through raindrops. The light is first refracted as it enters the surface of the raindrop, reflected off the back of the drop, and again refracted as it leaves the drop. The overall effect is that the incoming light is reflected back over a wide range of angles, with the most intense light at an angle of 40°–42°.
The water droplets in the air act like tiny prisms. The "white" light we see is actually made up of a combination of different colors so when the light passes thru these tiny prism droplets at the proper angle it breaks the white light into its basic color components (its color spectrum).
What makes rainbows the colours they are and in the same order is because angle of deviation is different for the two colors at either end of the rainbow because blue/violet coloured light is bent or refracted more than is the red light. The red light is refracted at around 42 degrees and we see the blue light on the inner part of the arc because we are looking along a different line of sight that has a smaller angle (40 degrees) for the blue. All the colours in between are at slightly smaller angles from the red. The diagram below from this informative site shows the red and blue light going through the water droplet.
Unfortunately due to this the Irish leprechaun's secret hiding place for his pot of gold is usually said to be at the end of the rainbow. This place is impossible to reach, because the rainbow is an optical effect which depends on the location of the viewer. When walking towards the end of a rainbow, it will move further away.