We present a study of the interaction of a W STM tip and the (110) and (111) surfaces of Pb. Atomic resolution has been obtained at room temperature on Pb(110) and up to 330 K on Pb(111). At higher temperatures the surfaces can jump to mechanical contact with the STM tip, resulting in the formation of a connecting neck of Pb between tip and surface. As the tip is retracted, the neck elongates and finally breaks. The dependence of the maximum neck size on the temperature and the tip retraction speed indicates that surface diffusion is responsible for the neck build-up. When the surface is partially oxidized the maximum neck size is reduced. We derive a scaling relation between the maximum neck size, the retraction speed and the surface diffusion coefficient. With this relation and the temperature dependence of the maximum neck size we obtain activation energies for the neck build-up of 1.3 and 0.9 eV respectively for necks on Pb(110) and Pb(111]). When a neck breaks, either a crater or a hillock is left on the surface.