  Context: Several binary systems hosting massive stars present gamma-ray
emission. In most of these systems, despite detailed observational information
being available, the nature and the structure of the emitter are still poorly
known.
  Aims: We investigate the validity of the so-called one-zone approximation for
the high-energy emitter in binary systems hosting a massive star. In
particular, the case of LS 5039 is considered.
  Methods: Assuming a point-like emitter at rest, the presence of a nearby
massive star, and the observed MeV and GeV fluxes as a reference, a non-thermal
leptonic model is systematically applied for different locations, magnetic
fields, and non-radiative losses. This allows us to identify both the emitter
configurations that are most compatible with observations and inconsistencies
between model predictions and the available data.
  Results: In the case of LS 5039, the best parameter combination is fast
non-radiative cooling and a low magnetic field. However, discrepancies appear
when comparing the model results at the MeV and GeV energy ranges with the
observed fluxes. Predictions fail when the orbital motion is included in the
analysis, because emitters and energy budgets that are too large are required.
Values of X-ray and TeV fluxes that are too high are predicted in such a case,
along half of the orbit.
  Conclusions: We show that the radiation in LS 5039 does not come from only
one electron population, and the emitter is likely extended and inhomogeneous
with a low magnetic field. We suggest that the emitter moves at relativistic
velocities with Doppler boosting playing a significant role.
  Key words. Stars: high-mass, X-rays: binaries, gamma-rays: binaries
