Nail said:
All earth, stone, and water in the spell's area is drained of heat. Earth, mud, and stone become everfrost and water freezes. You affect a 10-foot-square area to a depth of 1 foot. Magical, enchanted, dressed, or worked stone cannot be affected. Earth, stone, or water creatures are not affected.
Alright, so the portions of the lava that are Elemental Earth are frozen. The other half of the material, being Elemental Fire since this is D&D and magma is a paraelemental mix of the two in D&D, just continues to be insanely hot and superheats the frozen bits of elemental earth in an instant, quickly reabsorbing them into the molten mass of liquid lava.
Though, that said, since the spell says 'earth, stone, and water', and not simply 'earth and water' or the like, it seems clear to me that the designers' intent is that the use of these terms does not mean the broad elemental definitions of earth and water. In which case they mean earth as in dirt, soil, sand, etc. Which is why stone is also mentioned initially, as the spell also affects solid rock, not just the particulate bits of rock in soil. In which case, with these distinctions, I wouldn't expect it to function on molten, liquid stone, that being lava. It differentiates between loose earthen matter (earth and stone), and mud, and water, but does not mention other forms/states of earthen matter, so I would assume it does not work. Or, as above, it just works on the tiny, separate bits of stone amongst the lava, but only for the second or two that it takes for fire element in the mass to reheat those tiny bits of stone and re-liquify them as molten lava.