The statement that best describes how the energy of Earth's interior contributes to the formation of rocks on its surface is:
D. The energy in the Earth's interior melts rock, creating magma which cools back into rock when it reaches the surface.
This statement accurately captures the process of how magma, generated by the melting of rocks in the Earth's interior due to heat, can reach the surface and solidify into igneous rock.