Context. Massive stars form within dense clumps inside giant molecular clouds (GMCs). Finding appropriate chemical tracers of the dense gas (n(H2) > several 104 cm−3 or AV > 8 mag) and linking their line luminosity with the star formation rate is of critical importance. Aims. Our aim is to determine the origin and physical conditions of the HCN-emitting gas and study their relation to those of other molecules. Methods. In the context of the IRAM 30m ORION-B large program, we present 5 deg2 (~250 pc2) HCN, HNC, HCO+, and CO J =1–0 maps of the Orion B GMC, complemented with existing wide-field [C I] 492 GHz maps, as well as new pointed observations of rotationally excited HCN, HNC, H13CN, and HN13C lines. We compare the observed HCN line intensities with radiative transfer models including line overlap effects and electron excitation. Furthermore, we study the HCN/HNC isomeric abundance ratio with updated photochemical models. Results. We spectroscopically resolve the HCN J = 1–0 hyperfine structure (HFS) components (and partially resolved J = 2−1 and 3−2 components). We detect anomalous HFS line intensity (and line width) ratios almost everywhere in the cloud. About 70% of the total HCN J = 1−0 luminosity, L′(HCN J = 1−0) = 110 K km s−1 pc−2, arises from AV < 8 mag. The HCN/CO J = 1−0 line intensity ratio, widely used as a tracer of the dense gas fraction, shows a bimodal behavior with an inflection point at AV < 3 mag typical of translucent gas and illuminated cloud edges. We find that most of the HCN J = 1−0 emission arises from extended gas with n(H2) < 104 cm−3, and even lower density gas if the ionization fraction is χe ≥ 10−5 and electron excitation dominates. This result contrasts with the prevailing view of HCN J = 1−0 emission as a tracer of dense gas and explains the low-AV branch of the HCN/CO J = 1−0 intensity ratio distribution. Indeed, the highest HCN/CO ratios (~ 0.1) at AV < 3 mag correspond to regions of high [C I] 492 GHz/CO J = 1−0 intensity ratios (>1) characteristic of low-density photodissociation regions. The low surface brightness (≲ 1 K km s−1) and extended HCN and HCO+ J = 1−0 emission scale with IFIR – a proxy of the stellar far-ultraviolet (FUV) radiation field – in a similar way. Together with CO J = 1−0, these lines respond to increasing IFIR up to G0 ≃ 20. On the other hand, the bright HCN J = 1−0 emission (> 6 K km s−1) from dense gas in star-forming clumps weakly responds to IFIR once the FUV field becomes too intense (G0 > 1500). In contrast, HNC J = 1−0 and [C I] 492 GHz lines weakly respond to IFIR for all G0. The different power law scalings (produced by different chemistries, densities, and line excitation regimes) in a single but spatially resolved GMC resemble the variety of Kennicutt-Schmidt law indexes found in galaxy averages. Conclusions. Given the widespread and extended nature of the [C I] 492 GHz emission, as well as its spatial correlation with that of HCO+, HCN, and 13CO J = 1−0 lines (in this order), we argue that the edges of GMCs are porous to FUV radiation from nearby massive stars. Enhanced FUV radiation favors the formation and excitation of HCN on large scales, not only in dense star-forming clumps, and it leads to a relatively low value of the dense gas mass to total luminosity ratio, α (HCN) = 29 M⊙/(K km s−1pc2) in Orion B. As a corollary for extragalactic studies, we conclude that high HCN/CO J = 1−0 line intensity ratios do not always imply the presence of dense gas, which may be better traced by HNC than by HCN.