Although the phrase "melted rock" is used, technically the rock doesn’t melt at all. Instead the particles that form the rock change, causing crystals. Rocks that have melted are called metamorphic rocks. Metamorphic rocks are known as magma when they are under Earth's surface, and lava when a volcano expels them.
Heat is the most important factor affecting the melting point of rock. High temperatures cause the ions in the rock to move quickly, which results in a deformation of the rock. Rock melts when subjected to temperatures between 572 degrees Fahrenheit and 1,292 degrees Fahrenheit. Different types of rock, formed by different materials, will melt at different temperatures.
A great deal of pressure is inside Earth, which causes heat. Imagine rubbing your hands together very hard; this pressure causes heat. Something like this happens -- on a much-larger scale -- under Earth's surface, which is why magma exists in Earth’s core.
The higher the water content of the rocks, the lower the melting point, meaning that they require less heat to melt. The water mixes with the rock particles and speeds up the formation of crystals.
Certain types of rock, such as basalts, must be exposed to high temperatures for a very long time before they start to melt. This reaction is also dependent on the water content of the rocks -- basalts have a low water content; therefore, they take longer to melt. Also, the less pressure the rocks are subjected to, the longer it will take for them to melt.