Quantum theory of charge exchange scattering of atoms at solid surfaces