Dopant-to-host electron transfer is calculated using ab initio wavefunction-based embedded cluster methods for Yb/Ca pairs in CaF2 and Yb/Sr pairs in SrF2 crystals to investigate the mechanism of photoconductivity. The results show that, in these crystals, dopant-to-host electron transfer is a two-photon process mediated by the 4f(N-1)5d excited states of Yb2+: these are reached by the first photon excitation; then, they absorb the second photon, which provokes the Yb2+ + Ca2+ (Sr2+) -> Yb3+ + Ca+ (Sr+) electron phototransfer. This mechanism applies to all the observed Yb2+ 4f-5d absorption bands with the exception of the first one: Electron transfer cannot occur at the first band wavelengths in CaF2: Yb2+ because the Yb3+-Ca+ states are not reached by the two-photon absorption. In contrast, Yb-to-host electron transfer is possible in SrF2:Yb2+ at the wavelengths of the first 4f-5d absorption band, but the mechanism is different from that described above: first, the two-photon excitation process occurs within the Yb2+ active center, then, non-radiative Yb-to-Sr electron transfer can occur. All of these features allow to interpret consistently available photoconductivity experiments in these materials, including the modulation of the photoconductivity by the absorption spectrum, the differences in photoconductivity thresholds observed in both hosts, and the peculiar photosensitivity observed in the SrF2 host, associated with the lowest 4f-5d band. (C) 2015 AIP Publishing LLC.