The Interaction of an Atom with a Surface: A Model Based on Effective Medium Theory