In volcanology, magma is melted rock that is under the ground. It is like lava, which is melted rock above the ground. There are many types of magma. One is called felsic magma. Felsic magma is thick and has lots of a mineral called silica. It mostly makes light-coloured rocks. Another type is called mafic magma, which is runny and has less silica. It usually makes dark-coloured rocks. A third type is intermediate magma. It is like both the other types.
When magma becomes solid it's usually by cooling slowly, far below the surface. This makes "plutonic" rocks such as granite. Sometimes magma comes out from a volcano as lava, cools more quickly, and forms other kinds of rock.