It is lighter in weight than the colder, magma hard rocks around it. So it is slowly pushed upward by the pressure of the rock around it. In many places the never does reach the surface but slowly cools and hardens underground.
It takes thousands of years for magma to harden into rock. In other places the cold, hard rocks near the surface cannot withstand the pressure of the magma beneath them. They crack a little bit and the magma rises up along the rocks.
Magma often remains hot enough to stay in liquid form until it reaches the surface of the earth. It then flows through the cracks and spreads out on the ground. Magma that reaches the surface is called lava.
Magma usually starts cooling while it is still being pushed upward. As the magma slowly rises, certain minerals in it grow into big crystals sooner than the other minerals do. These crystals float in the magma. When this magma reaches the surface of the earth, the liquid rock turns to a solid state in a short time.
The big crystals carried in the liquid are "frozen" into the fine-grained lava rock. The whole rock is then made of many large crystals embedded in a very fine grained tock, such as basalt. Such rock is called Porphyry. It is very attractive and is often used as a building stone.
and folcels.