All igneous rocks have solidified from a molten state, either inside the Earth or on the surface. The lavas and molten fragments (pyroclasts) and ash produced by volcanoes are called extrusive igneous rocks, because they are formed by the extrusion of magma on to the Earth's surface. Other igneous rocks such as granite formed deep underground; these are called intrusive igneous rocks formed where magmas have cooled within the Earth.
Intrusive igneous rocks
Intrusive igneous rocks represent batches of magmas that didn't make it to the Earth's surface before cooling and solidifying. They form by the slow crystallisation of magmas, either at depth (several km below the Earth's surface) as large irregular intrusions or plutons, or nearer the surface in cracks and fractures as shallow minor intrusions such as dykes or sills.
Extrusive igneous rocks
Extrusive igneous rocks (sometimes called volcanic rocks) are formed when magma erupts at the surface. When magma reaches the surface it may spill out as a lava flow, either on land such as in Hawaii, or beneath the sea, such as on mid-oceanic ridges. Alternatively it may erupt explosively producing fragmental debris (pyroclasts) which eventually deposit on the surface, forming a pyroclastic rock. Differences in composition, mineralogy and crystallisation temperature of different magmas influence their eruptive style.
Magmas are complex chemical mixtures, containing many elements that organise themselves into several minerals as the magma crystallises. Each mineral in an igneous rock usually begins to crystallise at a different temperature. The fundamental control on the mineral composition of an igneous rock is the chemistry of the magma from which it crystallises. But chemistry is not the only thing that makes igneous rocks look different.
Various rocks will all have exactly the same chemical composition, but appear different because of the size of the crystals. The number and size of the crystals depends on the amount of time they have to grow. For extrusive rocks this can be seconds, for a small fragment of magma flying through the air, to a few years for the middle of a thick lava flow (e.g. basalt). This kind of rapid cooling results in small crystals because they have very little time to grow. For intrusive igneous rocks, the cooling rate is much slower (probably several thousand years!) and the magma has time to grow larger crystals (e.g. Gabbro). Generally speaking the slower the cooling, the bigger the crystals.
Sedimentary rocks form under a great variety of circumstances, such as glacial environments, deserts, rivers and coral reefs. They are formed by the laying down, or deposition of tiny grains which form layers of sediment. When sediment is transported by water in rivers or seas, it can settle to the bottom like tea leaves settle to the bottom of a cup. You can see sediment being deposited today in rivers and on beaches.
Where does all the sediment come from?
Sedimentary grains are formed when rocks at the Earth’s surface are weathered or broken up by water, wind, frost and ice. The tiny fragments and individual mineral grains are usually transported from one place to another by wind or water before being deposited as roughly horizontal layers of sediment.
With time these layers of sediment may themselves get washed or blown away, or they may be buried by yet more sediment and compacted. When this happens and water is squeezed out of the sediment, new minerals may grow in the spaces between the grains and the loose sediment grains become cemented together forming a solid sedimentary rock such as sandstone. Layers of sedimentary rocks are called beds.
Some sedimentary rocks contain fossils of plants or animals which were living at the time the sedimentary grains were deposited. Accumulations of shells and the calcite skeletons of marine organisms like corals make up a rock called limestone
Sedimentary rocks are often porous. The individual pore spaces are connected with each other. This means that liquids and gasses can move through the rock, so often reservoirs of water, oil and gas are contained within sedimentary rocks like sandstone.
Metamorphic are existing sedimentary and igneous rocks that have changed form. Any type of rock can undergo a change of form, becoming metamorphic rock, if it is heated to temperatures of several hundreds of degrees Celsius, and/or if subject to high pressure (because of the weight of overlying rocks).
An increase in pressure and temperature will come about if a rock becomes more deeply buried in the Earth as a result of earth movements, or if it is covered by a deepening layer of sedimentary deposits. Igneous and metamorphic rocks both have a crystalline texture and both form at high temperatures, but an important distinction is that metamorphism occurs in the solid state, whereas igneous rocks form from liquid (molten) rock.
During metamorphism, the atoms in the minerals making up the rock become reorganised, sometimes resulting in the regrowth of existing minerals (crystals), or in the formation of new minerals. As a result, the new rock may look very different from the original rock. The overall chemical composition of the rock normally remains about the same, however, with elements just rearranging themselves into new minerals that are more suited to the new temperature and pressure conditions. This is what happens during recrystallisation and can often result in banding or alignment of crystals in the rock.
You may already know of two metamorphic rocks, slate and marble. Although the terms slate and marble are often used to describe construction and ornamental stones, the colloquial use of 'slate' and 'marble' covers a much wider range of materials than is covered by the strict definitions of these metamorphic rocks. Slate is a metamorphic rock with an extremely fine grain size; it is difficult to make out individual crystals even with a hand lens. It was originally laid down as a soft mud, but it has been recrystallised and the result is a hard, water-resistant rock that can be split into thin sheets.
Marble is a metamorphic rock formed from limestone, but unlike schist and slate, marble doesn't always have a banded structure. This is because marble usually contains only one mineral, calcite, so there cannot be alternating bands of different minerals. This means that marble doesn't break along preferred directions like metamorphic rocks that contain minerals arranged in parallel bands. It therefore makes a good material for statues, as smooth surfaces can be carved in any direction. Any impurities in the marble tend to result in a mottled appearance.