Abstract It was shown that the high spatial and time coherency of the X-ray beam delivered at the ESRF allows one to observe very weak perturbation of the wave front, resulting in the phase contrast and undesirable speckle structure of the beam, that impose special requirements to all elements to be installed in the optical path such as beryllium windowns, filters and mirrors. The contrast from existing beryllium windows at the ESRF beamlines and specially polished Be foils was experimentally studied at an energy range from 10 to 20 keV. It was revealed that the uneven surface of the beryllium windows leads to a beam structure with intensity changes up to 50–100%. The theory of the phase contrast imaging by a transparent object was presented and some theoretical estimations were made to formulate the requirements imposed on the roughness of the Be window surface to avoid the unwanted deterioration of the beam spatial coherence.