When a solid is heated, the molecules that make up the solid begin to vibrate. This causes them to take up more space, and the solid matter expands. If the heat continues to build, it may provide enough energy for the particles to break free from their strong attraction to one another, causing the solid to melt.
The expansion of solids under heat is one of the reasons why large structures like buildings and bridges often have gaps in their joints. This allows the material to expand and contract without damaging the structure. This is also why seams in the pavement may seem more pronounced depending on the local weather conditions.
Lowering the temperature of a solid can cause it to contract. The molecules that make up the solid lose their energy to the surrounding atmosphere and take up less space. Shrink fitting is a technique that takes advantage of this property to fuse objects together. For instance, a bolt that is slightly too big for a hole is cooled until it shrinks enough to fit. Once in place, it is warmed until it expands and fuses with the rest of the material. This can produce a bond as strong as that created by a welding torch in some cases.