The three ways magma can form are when rock is heated, when pressure is released, and when the composition of the rock changes. The temperature of magma is 1300-2400F. Magma collects in magma chambers under the earth's surface, and can be come to the surface in the form of lava.