Magma is molten rock beneath Earth's surface that rises toward the surface due to being less dense than surrounding rock. Magma that reaches the surface erupts through volcanoes. There are different types of volcanoes that can have eruptions ranging from gentle lava flows to catastrophic explosions. The composition of magmas varies but is dominated by silica and results in three main types: basaltic, andesitic, and rhyolitic. Basaltic magma is erupted by most volcanoes and forms lava flows, while more viscous andesitic and rhyolitic magmas can lead to explosive eruptions due to gas bubbles rising slowly in the thick lava.