Soft-x-ray absorption and fluorescence measurements are reported for the K edge of B in MgB2. The measurements confirm a high density of B pxy(σ) states at the Fermi edge and extending to approximately 0.9 eV above the edge. A strong resonance is observed in elastic scattering through a core exciton derived from out-of-plane pz(π*) states. Another strong resonance, observed in both elastic and inelastic spectra, is identified as a product of surface boron oxides.