In microelectronics, during fabrication of ultrashallow p-n junctions boron is implanted in a silicon monocrystal. However, the subsequent rapid thermal annealing (RTA) causes anomalous fast diffusion (transient enhanced diffusion, TED) of the boron inwards in the crystal, hindering the formation of the desired ultrashallow junction. It was found that this accelerated diffusion can be overcome by applying a silica protective layer on top of the monocrystal and implanting BF 2 Y instead of elementary boron. This work offers a thermodynamic explanation as to why the silica layer and the presence of fluorine slow down the TED of boron. The nature, direction and magnitude of the thermodynamic forces controlling the processes are examined by two methods of approach. First, the problem is treated as the segregation-desegregation of boron at the interface, governed by excess surface Gibbs free energy of the components in the SiO 2 (B)-Si(B)-Si 'sandwich' structure. Second, the thermodynamic probability of solid-phase chemical interactions is considered and calculated by computer program. The effect of fluorine is treated according to its reaction with the silicon interstitials.