Here's a breakdown:
* Magma: Molten rock *beneath* the Earth's surface.
* Lava: Molten rock that has erupted *onto* the Earth's surface.
So, while the terms are often used interchangeably, they refer to the same material in different locations.