We investigate here for the first time GaN and AIGaN films by using x-ray photoemission spectromicroscopy. As compared to conventional x-ray photoemission spectroscopy (XPS), spectromicroscopy can provide spatially resolved information on the chemical composition of the sample surface. The experimental results where obtained by using MAXIMUM, a scanning photoemission microscope installed on 12.0 undulator beamline at the Advanced Light Source (ALS), Berkelely, allowing for a spatial resolution of 100 nm. We investigate here GaN and AlGaN thin films grown on sapphire substrate by metalorganic chemical vapor deposition (MOCVD). The results clearly indicate the great potential of spectromicroscopy in investigating chemical inhomogeneity, inpurities and localization in GaN and AlGaN thin films.