Lava is hot for two reasons:
- It’s hot deep in the Earth (about 100 km down) where rocks melt to make magma.
- The rock around the magma is a good insulator, so the magma doesn’t lose much heat on the way to the surface.
Org. answer by Steve Mattox