Answer: freezing
Freezing is defined as the process through which a substance changes its from from a liquid to a solid. As the liquid lava in the example has lost its thermal energy and thus has hardened, the phase change through which it has undergone is freezing. All liquids with the exception of helium undergo freezing then the average energy of the molecules decreases.
Solidification is another term often used to describe this phenomenon. However, it is much more general and can occur due to other factors such as reactions between different chemicals.