Calculations have been performed on the O(1s) X-ray absorption spectra of the O2- ion in the series of alkaline-earth oxides MgO, CaO, SrO. The static exchange approach has been used to calculate the near-edge X-ray absorption fine structure (NEXAFS) spectra for a range of cluster models (up to 50 atoms), representing both the (100) surface and the bulk of the different lattices. The clusters have been embedded in a proper representation of both the surrounding crystal ions and the Madelung potential generated by the infinite crystal. In the surface clusters discrete levels lying around 1.5 eV below the calculated ionization potential were found and characterized. This surface state has been studied further by performing complete active space self-consistent field (CASSCF) calculations in which the polarization of the crystal ions has been taken into account by means of a core polarization potential (CPP) method as well as the Mott-Littleton approach. After inclusion of this potential, the calculated ionization potentials show good agreement with XPS measurements.