what process occurs when rocks are baked by magma