Igneous rocks form when magma (molten rock) cools and crystallizes, either at volcanoes on the surface of the Earth or while the melted rock is still inside the crust. ... When lava comes out of a volcano and solidifies into extrusive igneous rock, also called volcanic, the rock cools very quickly.