Amorphous semiconductors are materials with a brilliant prospect for a wide range of optical applications like solar cells, optical sensors, optical devices, and memories. The purpose of the present research was to study the semiconducting optical properties of SiO2-Al2O3-CaF2 and SiO2-Al2O3-BaF2 oxyfluoride glassy systems, which has been rarely studied from this point of view. The suitable compositions in the mentioned systems were chosen and melted in covered alumina crucibles at 1450˚C. Afterward, preheated stainless steel molds were used to shape the molten glasses. The absence of any crystallization peak in the XRD results indicated that the samples were amorphous. DTA patterns showed that the crystallization temperature of the fluoride phase is 693˚C for the glass containing BaF2 (SAB), which is higher than the peak temperature (684˚C) for the glass with CaF2 (SAC). DTA results were in accordance with density measurements, i. e., the density of the glass SAB (3.85 g.cm-3) was higher than the glass SAC (2.70g.cm-3). That is to say, BaF2 presented a more continuous structure with lower amounts of dangling bonds. According to the UV- Vis spectra, sample SAB had higher absorption and smaller bandgap of the glass SAB (with a direct bandgap of 2.90 eV and indirect bandgap of 3.40 eV) indicated that it has better semiconducting behavior than sample SAC (with a direct bandgap of 3.07 eV and indirect bandgap of 3.60 eV). This increment of the semiconducting behavior is attributed to the more continuous structure of the glass SAB. Urbach energy, which is an indicator of disorder degree of structure, was 0.20 and 0.32eV for SAB and SAC, respectively. Therefore, the lower Urbach energy of SAB glass confirmed the higher structure order of it.