A theoretically based relationship for the Darcy–Weisbach friction factor $f$ for rough-bed open-channel flows is derived and discussed. The derivation procedure is based on the double averaging (in time and space) of the Navier–Stokes equation followed by repeated integration across the flow. The obtained relationship explicitly shows that the friction factor can be split into at least five additive components, due to: (i) viscous stress; (ii) turbulent stress; (iii) dispersive stress (which in turn can be subdivided into two parts, due to bed roughness and secondary currents); (iv) flow unsteadiness and non-uniformity; and (v) spatial heterogeneity of fluid stresses in a bed-parallel plane. These constitutive components account for the roughness geometry effect and highlight the significance of the turbulent and dispersive stresses in the near-bed region where their values are largest. To explore the potential of the proposed relationship, an extensive data set has been assembled by employing specially designed large-eddy simulations and laboratory experiments for a wide range of Reynolds numbers. Flows over self-affine rough boundaries, which are representative of natural and man-made surfaces, are considered. The data analysis focuses on the effects of roughness geometry (i.e. spectral slope in the bed elevation spectra), relative submergence of roughness elements and flow and roughness Reynolds numbers, all of which are found to be substantial. It is revealed that at sufficiently high Reynolds numbers the roughness-induced and secondary-currents-induced dispersive stresses may play significant roles in generating bed friction, complementing the dominant turbulent stress contribution.