We prepared a Pt-terminated PtRu near-surface alloy with a lateral concentration gradient on Pt(111). The near-surface alloy is exposed to CO at 100 K or O2 at 600 K and subsequently investigated using synchrotron-based high-resolution X-ray photoelectron spectroscopy. By moving the sample laterally under the focused X-ray beam (spot size ∼0.05 mm), we were able to study locally different alloy compositions under identical measurement conditions. With increasing subsurface Ru concentration, we observe a gradual decrease in the CO occupancy of Pt bridge sites, while the amount of on-top adsorbed CO remains constant over the investigated compositional range. Oxidation of the alloy reveals a clear increase in the fraction of oxidized Ru atoms (the RuOx : Ru ratio) with increasing Ru content.