It rises along cracks in the Earth's crust. If it solidifies before it reaches the surface it forms an intrusive igneous rock. If it is thrown out by volcanic action, it forms an extrusive igneous rock. Intrusive rocks cool very slowly. Their minerals form large crystals.
Granite is an example.
Intrusive rocks become exposed on the Earth's surface when the overlying material is worn away. Magma that erupts through volcanoes is known as lava. The material may cool so rapidly that no crystals can form. Obsidian is a glasslike rock formed in this way. The various lava rocks differ in the rapidity with which they cool and in the way their crystals form.