Cubic and hexagonal phases of boron nitride (c-BN and h-BN) have been identified and located using optically detected x-ray absorption spectroscopy (ODXAS). Each phase was identified by distinct resonance features in the B K-edge absorption spectra. In a mixed-phase sample of predominantly c-BN, combined ODXAS and electron yield measurements suggested near-surface localization of h-BN. Using x-ray excited luminescence, emission bands due to each phase were identified and applied in wavelength-selective ODXAS to locate surface and bulk h-BN phases. These combined techniques provide a method of correlating the local structure and optical emission in these wide-gap semiconductors.