Peroxy acetyl nitrate (PAN) is a key component of photochemical smog and plays an important role in atmospheric chemistry. Though it has been known that PAN is produced via reactions of nitrogen oxides (NOx) with some volatile organic compounds (VOCs), it is difficult to quantify the contributions of individual precursor species. Here we use an explicit photochemical model--Master Chemical Mechanism (MCM) model--to dissect PAN formation and identify principal precursors, by analyzing measurements made in Beijing in summer 2008. PAN production was sensitive to both NOx and VOCs. Isoprene was the predominant VOC precursor at suburb with biogenic impact, whilst anthropogenic hydrocarbons dominated at downtown. PAN production was attributable to a relatively small class of compounds including NOx, xylenes, trimethylbenzenes, trans/cis-2-butenes, toluene, and propene. MCM can advance understanding of PAN photochemistry to a species level, and provide more relevant recommendations for mitigating photochemical pollution in large cities.