Gamma-ray binaries are systems containing a massive star and a compact object that have been detected up to TeV energies. The high-energy emission could result from particle acceleration in the region where the stellar wind from the massive star interacts with the relativistic wind from a young pulsar. LS 5039 has the most compact orbit amongst gamma-ray binaries and its X-ray light curve shows a stable modulation synchronized with the orbital period. Photoelectric absorption of X-rays in the O star wind and occultation of the X-ray emitting region by the massive star can alter the X-ray light curve and spectrum along the orbit. Yet, the X-ray spectrum and light curve of LS 5039 do not show intrinsic absorption or X-ray eclipses. We study these effects in the framework of the pulsar wind scenario as a function of the binary inclination angle, the stellar wind mass-loss rate and the size of the X-ray emitter. An extended X-ray emission region ≳3R★ appears necessary to reconcile the pulsar wind scenario with observations.