Using X-ray grazing incidence diffraction (GID) it is possible to perform a nondestructive analysis of the heterogeneous stress field for different volumes below the surface of the sample. The stress can be measured at very small depths, of the order of a few μm. The penetration depth of radiation is almost constant in a wide 2θ range for a given incidence angle α. It can be easily changed by an appropriate selection of α angle (or also by using a different type of radiation). There are, however, some factors which have to be corrected in this technique. The most important is the refraction of X-ray wave: it changes the wavelength and direction of the beam. Both effects modify a pick position. A corresponding correction was calculated and tested on ferrite powder and on 316L austenite stainless steel sample.