Gas cools, particles no longer have enough energy to overcome forces of attraction so bonds form. Until the boiling point, so many bonds formed that gas becomes liquid- condensing. At the melting point, there is no more energy to form more bonds but there are even more so they're held in place. Liquid becomes solid- freezing.