Our planet Earth resembles an egg on top with a thin hard shell - crust, beneath it is a viscous layer of hot mantle, and in the center is solid core. The crust of the earth is called the lithosphere, which translated from Greek means "a stone shell. The thickness of the lithosphere on average about 1% of the radius of the globe. On land, it is 70-80 kilometers, and in the depths of the oceans may be only 20 kilometers.
The temperature of the mantle - thousand degrees. Closer to the core temperature of the mantle is more closer to the bark - less. Due to the difference of the temperatures of mixing of mantle material: hot masses rise up and cool - down (like boiling water in a saucepan or kettle, but it happens thousands of times slower). Mantle, though heated to enormous temperatures, but because of the enormous pressure in the center of the Earth it is not liquid and viscous, like a very thick resin. The lithosphere, as if floating in the viscous mantle, a little lost in it under the weight of its weight.

Reaching the lithosphere bottom, cooling the mass of the mantle while moving horizontally along the solid stone "shell", but then, cooled down, it falls back toward the Earth's center. While the mantle lithosphere moves along with it Willy-nilly moving pieces of the earth's crust (lithosphere plates), parts of stone mosaic face and crawl against each other.
Part of the plate, which are on the bottom (which was covering the other plate), gradually sinking into the mantle and begins to melt. Thus, there is a magma - the dense mass of molten rock with gases and water vapor. Magma is lighter than the surrounding rocks, so she slowly rises to the surface and accumulates in the so-called magmatic foci. They are often located along the line of collision of plates.
Magma is more liquid than the mantle, but still thick enough. In Greek "magma" means "thick paste" or "paste".
The behavior of hot magma in the magmatic chamber and the truth is reminiscent of yeast dough: magma increases in volume, occupies all space and rises from the depths of the Earth through the cracks, trying to break free. As the dough lifts the lid of the pan and flows over the edge, and the magma breaks through the crust of the earth in the weakest places and rises to the surface. This is the eruption of a volcano.
The eruption is due to degassing of magma, that is, the exit gases from it. The degassing process known to everyone: if you carefully open a bottle of fizzy drink (lemonade, Coca-Cola, kvass or champagne), there was cotton, and from a bottle of smoke appears, and sometimes the foam is of the beverage exits the gas (that is it degassing). If a bottle of champagne before opening shock or heat, then it will break out a powerful jet, and to keep this process is impossible. And if the bottle is not closed, then this stream can knock the cork from the bottle.

The lava flow from the eruption of the volcano
Unlike fizzy drinks, gases that are released during volcanic eruption, is flammable, so they ignite and explode in the mouth of the volcano. The force of the explosion of the volcano is so powerful that in place of the mountains after the eruption remains a huge "funnel" (Caldera), and if the eruption continues, right in this depression starts to grow a new volcano.
However, it happens that the magma is able to find the easy way out on the surface of the Earth, then the lava flows from volcanoes with no explosions. So boiling porridge, gurgle, overflowing the pan. For this type erupt, for example, the volcanoes in the Hawaiian Islands. The magma does not always have the strength to come to the surface, and then it slowly solidifies at depth. In this case, the volcano is not formed.
How does a volcano?
When you open "valve" in the Land (wikibedia tube volcano), the pressure in the upper part of the magmatic focus is sharply reduced. At the bottom, where the pressure is still large, the dissolved gases are still part of the magma. In the crater of the volcano from magma already starting to stand out bubbles of gas: the higher, the more they become larger; these light "balloons" rise up and carry viscous magma. About the surface of the already formed a solid foamy mass (hardened volcanic stone foam even lighter than water is known to all pumice). Degassing magma ends on the surface, where, after escaping to freedom, it turns into lava, ash, and hot gases, water vapor and fragments of rocks.

Pumice

Geyser
Extinct (or ancient) volcanoes are those who worked in the distant geological past. For example, the Scottish capital city of Edinburgh stands on an ancient volcano, which erupted more than 300 million years ago (then and dinosaurs-it was not).
To summarize
In the movement of lithospheric plates can occur pockets of magma. When magma rises to the surface of the Earth, begins with the eruption of the volcano. Often the eruption is accompanied by a powerful explosions, this is due to magma degassing and explosion of flammable gases. Volcano falls asleep, if stop flow of new portions of magma from the magma of the hearth, but can Wake up (come to life), if the movement of the plates continues magmatic hearth again filled. Volcanoes tugnut finally, if the movement of plates in the area stops.