In a recent paper we presented a contribution to the theory of metal surfaces with emphasis on the shape of the electron-density distribution and the surface energy. The present paper extends this analysis to a consideration of the work function. Some general theoretical relationships are established. Effects of the ions are included using a simple pseudopotential theory, permitting the calculation of the variation of the work function from one crystal face to another. For simple metals (Li, Na, K, Rb, Cs, Al, Pb, Zn, and Mg), agreement with available experimental data is good (5-10%); for the noble metals, the computed work functions are 15-30% too low.