There are three major groups of rock:
They are all related through a continuous cycle called the rock cycle.
Igneous rocks are created by melting and crystallization of molten material called magma. If the magma reaches the surface, the rocks are said to be extrusive. Volcanic lava flows are examples of extrusive igneous rocks. If the magma cools within the Earth it forms large bodies of crystalline rock called plutons or batholiths. These rocks are called intrusive igneous rocks.
Sedimentary rocks are formed in layers deposited by wind, water or ice. The are the product of the process of weathering. As sedimentary layers are buried they are cemented and lithified.
Metamorphic rocks are rocks formed by the action of pressure, temperature and fluids within the Earth. As sediments are deeply buried they are deformed and new minerals recrystallize at the elevated temperatures and pressures to form metamorphic rocks.