Energies of atoms, H through Ar, embedded in a homogeneous electron gas are calculated within the density-functional scheme as a function of the electron-gas density. The energy-versus-density curves and the induced densities of states are analyzed and discussed in terms of the interaction properties of an atom with its environment. The low-density limit of the immersion energy is related to the electron-atom scattering length. The results should prove useful in detailed investigations of the recently suggested "quasiatom" or "effective-medium" approaches to chemical binding. The lowest-order estimates of the binding energies of diatomic molecules and chemisorbed atoms are obtained.