As the magma deep underground rises to the surface, it crystallises with the reduction in pressure and the water forms bubbles.The magma releases heat, and its temperature rises from 900C to 1000C.

When the molten rock reaches the surface, the combination of water bubbles and temperature increase blows out the magma with explosive force, much like champagne spurting from a bottle when it is uncorked. "By looking in great detail at the erupting rock, we've been able to show that, as the magma ascends beneath the volcano prior to an eruption, it crystallises in response to the drop in pressure and it also gets hotter," said Professor Jon Blundy of Bristol University, who led the work, published today in Nature.

"This work is now being used to gauge the direction of current volcanic activity at Mount St Helens in the US and could be applied to any active volcano for which monitoring and petrological records are available." The magma can increase in temperature by about 100C in just a few years. This provides a trigger for an eruption without the need for an outside heat source, such as hotter magma below.

Scientists normally monitor active volcanoes by measuring how the ground around them deforms and how the gases they release change over time. Local earthquakes can also provide clues on how magma is moving under a volcano. Explosive volcanic eruptions are caused by the escape of gases from magma stored in underground reservoirs. Monitoring magma has been difficult because it is so far below the Earth's surface. "What we've done is study little droplets of volcanic liquid that are trapped inside the magma as it rises to the surface," said Madeleine Humphreys of Cambridge University, speaking yesterday at the British Association festival of science in Norwich.

By measuring the water and chemical content of these droplets, called melt inclusions, the researchers were able to tell how the magma was moving underneath the volcano and what condition it was in.

If the magma is at high pressure under the volcano, it will contain a lot of water and can form a lot of bubbles. "The sort of material that's ejected by a volcano during its precursory activity could hold the clues to what's going on underground and might indicate what might happen in the future," said Prof Blundy. "More bubbles, more explosive eruptions. If the magma is stored at a low pressure, [there is] potential to form bubbles and less explosive potential."

In their study, the researchers looked at the lava thrown out of Mount St Helens in the US and Shiveluch in Kamchatka, Russia. Mount St Helens erupted in May 1980 because of sudden decompression of the magma under the volcano. Prof Blundy said the release of pressure was like smashing the top off a bottle of champagne after giving it a vigorous shake.

Mount St Helens lay dormant until 2004, when large columns of magma started erupting from the top of the volcano. Analysis of current eruptions shows that it is unlikely to explode soon, Prof Blundy said.

Combining the analysis of melt inclusions with traditional observations of volcanoes was the "holy grail of modern volcanology," he said.