Calculations based on the density functional theory have achieved considerable reliability for the prediction of the properties of materials. In the present work, we have obtained enthalpies of formation of binary intermetallic compounds of boron with the rare-earth elements. These values have been calculated using the Vienna ab-initio simulation package in the generalized gradient approximation. In the Y-B system, we predict that Y2B5 in the mP28-Gd2B5 type structure is thermodynamically stable. We have compared the calculated enthalpies of formation of compounds to the values obtained with calorimetric methods. An excellent agreement is observed for some compounds: YB4, LaB6, LaB4, PrB4, and NdB4. However, the experimental values of the formation enthalpies of the rare earth diborides are systematically less exothermic than the calculated values except for the ScB2 compound where the experimental value is considerably more negative than the calculated one. The evolution of the enthalpies of formation along the series Sc, Y, La and La to Gd to Lu is discussed. The behaviour of the Y and Gd with respect to boron is found to be very similar. In a lesser extent, it is the same for the Sc and Lu with respect to boron.