In this work, the spontaneous and photolytically activated reactions of Ga and In atoms (M) with O2 (in Ar and solid O2) are studied with the aid of the matrix-isolation technique and the use of IR, Raman, and UV/Vis spectroscopy in combination with detailed quantum-chemical calculations. Vibrational spectra were recorded for several different isotopomers (69Ga, 71Ga, 16O2, 18O2, 16O18O). The results show that the spontaneously formed cyclic MO2 molecules photoisomerize to give the linear OMO molecules. The collected vibrational data were then used to characterize the bond properties of the linear OMO molecules in detail. The results are compared to those obtained for CO2(+) and neutral OEO compounds, where E is an element of Group 14. Quantum-chemical calculations were carried out at various levels of theory for GaO2. These calculations indicate that linear OMO is slightly more stable than its cyclic isomer. These calculations were also used to obtain information about the reaction mechanism, and show that the formation of the cyclic isomer from Ga atoms and O2 occurs without a significant barrier. Abrupt changes of the dipole moment and the O-O bond length during the approach of the O2 molecule toward the Ga atom mark the point on the potential energy surface at which one electron jumps from the Ga atom onto the O2 unit. The isomerization of cyclic GaO2 to the linear global minimum structure is accompanied by a significant barrier, which explains why this reaction requires photoactivation.