What you are actually looking at when you see a rainbow is falling rain. The falling rain causes white sunlight to bend into separate wavelengths of visible light. This is what causes the colorful bands that form the rainbow.
To see a rainbow it must be raining in one part of the sky (in front of you) and the sun must be shining behind you.
Each color that we see has a particular wavelength that corresponds to the above color spectrum chart.
Short wavelengths are perceived as purple or blue and longer wavelengths are perceived as red or orange.
The actual colors in the rainbow are dependent upon which wavelengths the rain bends the light into from your position.
The raindrops act like a prism separating white sunlight into its separate wavelengths in a manner similar to the photo below:
When you see a rainbow the sun will always be in back of you and the falling rain will be in front of you.
The rainbow continually changes because each falling raindrop bends the light slightly differently.
In addition, no two people ever see the same rainbow because the wavelenghts of light will be slightly different depending on where you are in relation to the falling rain.
Contrary to popular folklore, there is no pot of gold at the end of the rainbow. As a child I looked for this mythical pot of gold, only to find that you can never actually reach the end of the rainbow. This is because it continually moves as you attempt to move toward it or the rainbow may disappear completely as you approach the falling rain.