Volcanoes form when magma rises from deep within the Earth and erupts at the surface through openings called vents. As eruptions continue over time, layers of lava and ash build up to form volcanic mountains. There are three main types of volcanoes that occur in different areas: shield volcanoes like those in Hawaii form from gentle eruptions of basaltic lava; cinder cones are formed by explosive eruptions that eject tephra; and composite volcanoes can have both gentle and explosive eruptions of different materials over time. The type of eruption depends on the viscosity of the magma and amount of dissolved gases.