Photoemission from rare-gas atoms adsorbed on surfaces offers a unique analytical tool for the determination of the work function appropriate to microscopically small regions of a substrate surface. The chemical activity of small regions, such as steps and corners, and the fact that the local work function determines the relative energies of substrate and adsorbate electronic levels makes the determination of the local work function potentially very important. Here we provide a detailed microscopic picture of the special aspects of rare-gas adsorption that make such measurements possible. The discussion is based on the results of parameter-free self-consistent-field calculations for individual rare-gas atoms on a free-electron metal.