When enough magma builds up in the magma chamber, it forces its way up to the surface and erupts, often causing volcanic eruptions. In the ocean, volcanoes erupt along cracks that are opened in the ocean floor by the spreading of two plates called a mid-ocean ridge .