The formation of the resonance lines of neutral boron in solar-type stellar atmospheres is investigated taking into account effects of departures from local thermodynamic equilibrium (NLTE effects). The latter are due to a combination of overionisation and optical pumping in resonance lines, both caused by the hot, non-local, ultraviolet radiation fields in the line-forming regions. They lead to an underestimation of the boron abundance when analysis methods assuming local thermodynamic equilibrium (LTE) are used. The abundance correction, for the 249.7~nm resonance line, amounts to $+$0.6 dex for the metal-poor star HD140283 and $+$0.4 dex for Procyon. No significant NLTE effects are predicted for the Sun. Applying the abundance correction on the results for HD140283 of Duncan et al. (1992) leads to a B/Be ratio well above the minimum value required by spallation production of beryllium. The reliability of the results in view of atomic and atmospheric uncertainties is discussed. With the possible exception of photospheric inhomogeneity, it seems unlikely that these could remove the effect for HD140283.