Excitation of an atom near a surface