Answer :

They mostly follow the boundaries of tectonic plates, which are generally along the edges of continents. If you want to be even more specific, the "Ring of Fire" around the Pacific plate has the most. 
Volcanoes form as a plate that is subducted (an oceanic plate) melts in the Benioff Zone, the lower part of the Subduction Zone, forming viscous andesitic magma. The magma is less dense than the surroundings and so rises to form magma reservoirs near the surface. This magma then forms a volcano, which may erupt when more of the plate melts. In the same place, when one plate is subducted beneath another, enormous vibrations are generated which causes an earthquake