<i>Context. <i/>The mass-loss rate is a key parameter of hot, massive stars. Small-scale inhomogeneities (clumping) in the winds of these stars are conventionally included in spectral analyses by assuming optically thin clumps, a void inter-clump medium, and a smooth velocity field. To reconcile investigations of different diagnostics (in particular, unsaturated UV resonance lines vs. /radio emission) within such models, a highly clumped wind with very low mass-loss rates needs to be invoked, where the resonance lines seem to indicate rates an order of magnitude (or even more) lower than previously accepted values. If found to be realistic, this would challenge the radiative line-driven wind theory and have dramatic consequences for the evolution of massive stars. <i>Aims. <i/>We investigate basic properties of the formation of resonance lines in small-scale inhomogeneous hot star winds with non-monotonic velocity fields.<i>Methods. <i/>We study inhomogeneous wind structures by means of 2D stochastic and pseudo-2D radiation-hydrodynamic wind models, constructed by assembling 1D snapshots in radially independent slices. A Monte-Carlo radiative transfer code, which treats the resonance line formation in an axially symmetric spherical wind (without resorting to the Sobolev approximation), is presented and used to produce synthetic line spectra.<i>Results. <i/>The optically thin clumping limit is only valid for very weak lines. The detailed density structure, the inter-clump medium, and the non-monotonic velocity field are all important for the line formation. We confirm previous findings that radiation-hydrodynamic wind models reproduce observed characteristics of strong lines (e.g., the black troughs) without applying the highly supersonic “microturbulence” needed in smooth models. For intermediate strong lines, the velocity spans of the clumps are of central importance. Current radiation-hydrodynamic models predict spans that are too large to reproduce observed profiles unless a very low mass-loss rate is invoked. By simulating lower spans in 2D stochastic models, the profile strengths become drastically reduced, and are consistent with higher mass-loss rates. To simultaneously meet the constraints from strong lines, the inter-clump medium must be non-void. A first comparison to the observed Phosphorus V doublet in the O6 supergiant <i>λ<i/> Cep confirms that line profiles calculated from a stochastic 2D model reproduce observations with a mass-loss rate approximately ten times higher than that derived from the same lines but assuming optically thin clumping. Tentatively this may resolve discrepancies between theoretical predictions, evolutionary constraints, and recent derived mass-loss rates, and suggests a re-investigation of the clump structure predicted by current radiation-hydrodynamic models.