The case of a crystal containing a thin buried layer is analysed within the dynamical theory of X-ray diffraction. In this case, the upper thin part of the crystal, above the buffed layer, is only shifted with respect to the lower bulk part. The main feature is the phase shift q9 for the structure factors between the upper thin part and the lower bulk part. Owing to this phase shift, the backward wavefield, the wavefield with the energy flux directed out of the crystal, is excited in the thin part of the crystal. It is found that only the backward wavefield may be excited within the Bragg total reflection. This gives rise to anomalous transmission of the X-rays in the crystal. When the crystal is tilted across the Bragg angle, the variation of the intensity of X-rays in the buried layer due to the transmission term may be stronger than the one due to the anomalous absorption. Thus, this phenomenon should be taken into account in X-ray standing-wave (XSW) analysis. The excitation of the backward wavefield is also responsible for the appearance of oscillations in the reflectivity profile. The oscillation period is determined by the thickness of the upper thin part. The position and the amplitude of the oscillation directly provide the value of the phase qg. It is thus interesting to simultaneously record the X-ray reflectivity and the XSW measurements when studying the buried layer.