[ Astronomy & Space ] Open Question : How do comets survive when they get the closest to the Sun in their orbits?

Is there a scientific process that stops the blazing heat of the Sun from melting the ice of comets when they pass at their closest? How do they keep their shape?