The change in gravitational potential energy can be calculated from Newton's law of universal gravitation. The kinetic energy gained by the falling spacecraft has to go somewhere. It can be turned into heat, or (hopefully not) an impact crater when it hits the ground.