Neutron and synchrotron strain or stress evaluations are reliable when the probe volume is completely immersed in the studied material. However, acquisitions carried out close to interfaces are much more difficult to analyze. Under these conditions, it is indeed very difficult to characterize precisely the volume analyzed by the radiation and finally to define the measured depth. To solve this problem, a complete Monte Carlo simulation of neutron spectrometers and synchrotron experiments has been developed. This method allows defining precisely the size and shape of the probe used. It permits then predicting the evolution of the diffracted intensity versus the position of this volume in the matter. The calculations finally let to define the real analyzed depth, accounting for the local conditions of diffraction and absorption in the material. The method is illustrated by neutron and synchrotron experiments carried out to characterize stress fields existing close to interfaces. The simulations also permit predicting the shape of diffraction profiles that would be observed on perfect specimens. Such information can then be used to correct the instrumental broadening existing in real experiments. This allows a fine Fourier analysis of the diffraction peaks recorded for several orders of reflection and finally permits defining the mean size of the crystallites and the root mean squares of the strains of second and third kind. Such information is useful to characterize and analyze the mechanical behavior of materials.