|MadSci Network: Chemistry|
Soap bubbles are made up of very thin alternate layers of soap and water sandwiched together. These layers can slide past each other forming thicker or thinner layers in the process. The colours are caused by interference between the layers and the actual colour will depend on the temporary thickness and number of layers as the layers slide around on the surface. A soap/water/soap sandwich is made up of the soap heads and tails lining up above and below the water trapping it into a layer.
Try the links in the MadSci Library for more information on Chemistry.