Theory of charge exchange scattering from surfaces