Theory of atom-metal interactions. I. Alkali atom adsorption