To enhance the thermal stability, B4C diffusion barrier layers are often added to Mo/Si multilayer structures for extreme ultraviolet optics. Knowledge about the chemical interaction between B4C and Mo or Si however is largely lacking. Therefore, the chemical processes during annealing up to 600°C of a Mo/B4C/Si layered structure have been investigated in situ with Hard X-ray Photoelectron Spectroscopy and ex situ with depth profiling X-ray Photoelectron Spectroscopy. Mo/B/Si and Mo/C/Si structures have also been analyzed as reference systems. The chemical processes in these systems have been identified, with two stages being distinguished. In the first stage, B and C diffuse and react predominantly with Mo. MoSix forms in the second stage. If the diffusion barrier consists of C or B4C, a compound forms that is stable up to the maximum probed temperature and annealing time. We suggest that the diffusion barrier function of B4C interlayers as reported in literature can be caused by the stability of the formed compound, rather than by the stability of B4C itself.