Magma and lava from volcanic eruptions cool and solidify to form igneous rocks.
While under ground, hot molten rock is called magma and can reach over 1200 deg Celsius.
When it cools it forms igneous rock.