A method for determining correct depth profiles from samples with rough surfaces is presented. The method combines Rutherford backscattering spectrometry with atomic force microscopy. The topographical information obtained by atomic force microscopy is used to calculate the effect of the surface roughness on the backscattering spectrum. As an example, annealed Au/ZnSe heterostructures are studied. Gold grains were observed on the surfaces of the annealed samples. The annealing also caused diffusion of gold into the ZnSe. Backscattering spectra of the samples were measured with a 2 MeV 4He+ ion beam. A scanning nuclear microprobe was used to verify the results by measuring backscattering from grains and from areas of the samples where no grains had been formed during annealing.