Aims. Our aim is to study the response of the gas-to-energetic processes associated with high-mass star formation and compare it with previously published studies on low-and intermediate-mass young stellar objects (YSOs) using the same methods. The quantified far-IR line emission and absorption of CO, H 2 O, OH, and [O i] reveals the excitation and the relative contribution of different atomic and molecular species to the gas cooling budget. Methods. Herschel/PACS spectra covering 55-190 μm are analyzed for ten high-mass star forming regions of luminosities L bol ∼ 10 4 −10 6 L and various evolutionary stages on spatial scales of ∼10 4 AU. Radiative transfer models are used to determine the contribution of the quiescent envelope to the far-IR CO emission. Results. The close environments of high-mass protostars show strong far-IR emission from molecules, atoms, and ions. Water is detected in all 10 objects even up to high excitation lines, often in absorption at the shorter wavelengths and in emission at the longer wavelengths. CO transitions from J = 14−13 up to typically 29−28 (E u /k B ∼ 580−2400 K) show a single temperature component with a rotational temperature of T rot ∼ 300 K. Typical H 2 O excitation temperatures are T rot ∼250 K, while OH has T rot ∼ 80 K.Far-IR line cooling is dominated by CO (∼75%) and, to a smaller extent, by [O i] (∼20%), which becomes more important for the most evolved sources. H 2 O is less important as a coolant for high-mass sources because many lines are in absorption. Conclusions. Emission from the quiescent envelope is responsible for ∼45-85% of the total CO luminosity in high-mass sources compared with only ∼10% for low-mass YSOs. The highest−J lines (J up ≥ 20) originate most likely in shocks, based on the strong correlation of CO and H 2 O with physical parameters (L bol , M env ) of the sources from low-to high-mass YSOs. The excitation of warm CO described by T rot ∼ 300 K is very similar for all mass regimes, whereas H 2 O temperatures are ∼100 K high for high-mass sources compared with low-mass YSOs. The total far-IR cooling in lines correlates strongly with bolometric luminosity, consistent with previous studies restricted to low-mass YSOs. Molecular cooling (CO, H 2 O, and OH) is ∼4 times greater than cooling by oxygen atoms for all mass regimes. The total far-IR line luminosity is about 10 −3 and 10 −5 times lower than the dust luminosity for the lowand high-mass star forming regions, respectively.