The oxygen reduction reaction (ORR) mechanism of non-Pt catalysts was elucidated by investigating electronic structures of carbon alloy catalysts (CACs) for polymer electrolyte membrane fuel cells (PEMFC). For metal phthalocyanine-based carbon alloy catalysts with 1-2% of nitrogen and less than 0.1% of Co or Fe, photoelectron spectroscopy, X-ray absorption spectroscopy (XAS), and X-ray Absorption Fine Structure (XAFS) have revealed that Co or Fe metal sites are not the ORR active site, whereas the carbon atoms adjacent to graphitic nitrogens at a zigzag edge of graphite may act as the ORR active site, which is in good agreement with first principles calculations. These studies have also revealed that the zigzag edges, detected as a XAS shoulder component, are well evolved for catalysts pyrolyzed at 600°C, which show the maximum ORR activity. Based on these analyses, we have realized significantly improved carbon alloy based ORR performance, up to about 70 % of that with Pt catalysts. Further, to analyze the electronic structure of CACs during operation, we constructed a new in situ soft X-ray emission spectroscopy system with very high energy resolution (ΔE) of 120 meV at 640 eV at the University of Tokyo beamline BL07LSU in SPring-8.