The noncontact (van der Waals) friction is an interesting physical effect which has been the subject of controversial scientific discussion. The direct friction term due to the thermal fluctuations of the electromagnetic field leads to a friction force proportional to 1/Z^5 where Z is the atom-wall distance). The backaction friction term takes into account the feedback of thermal fluctuations of the atomic dipole moment onto the motion of the atom and scales as 1/Z^8. We investigate noncontact friction effects for the interactions of hydrogen, ground-state helium and metastable helium atoms with alpha-quartz (SiO_2), gold (Au) and calcium difluorite (CaF_2). We find that the backaction term dominates over the direct term induced by the thermal electromagnetic fluctuations inside the material, over wide distance ranges. The friction coefficients obtained for gold are smaller than those for SiO_2 and CaF_2 by several orders of magnitude.