A new, efficient, hybrid Monte Carlo method (‘trajectory-weighting’ method) for the calculation of XPS and AES spectra is presented. The method produces, in one single calculation, XPS or AES spectra for a large number of sample compositions. The method consists of a conventional Monte Carlo calculation for a single standard composition plus transformations for many other compositions. The transformations are based upon proper weighting of the electron trajectories constructed for the standard composition. The weighting factors depend on the elastic and inelastic scattering cross-sections. The trajectory-weighting method has been tested against a conventional Monte Carlo simulation and an analytical model. Furthermore, it has been applied to establish the XPS spectrum dependence on thickness, depth and composition of a buried layer in an otherwise homogeneous sample. © 1997 by John Wiley & Sons, Ltd.