Opal is a lot more common than people think, but it's usually a thin whitish film that lines fractures in rocks subjected to diagenesis or very mild metamorphism. Opal is commonly found with agate, which is cryptocrystalline quartz. Sometimes it is a bit thicker and has some internal structure that produces the highlights and color range of gem opal. This spectacular example of black opal is from Australia, where nearly all of the world's supply is mined.
The colors of gem opal arise as light diffracts in the ghostly internal structure of the material. The background layer, or potch, behind the colorful part of the opal is important too. The black potch of this black opal makes the colors appear especially strong. More typically, opal has a white potch, translucent potch (crystal opal) or clear potch (jelly opal).