Answer :
The energy from the hot magma that you speak of, is called geothermal energy. When we are talking about geothermal energy, we are talking about this energy that arises due to the heat from the Earth. It doesn't always have to do with magma, so it can range from shallow ground to hot water and hot rock found a few miles beneath the Earth's surface, and it will go down deep to extremely high temperatures of molten rock called magma.