Glaucoma, a disease characterized by progressive optic nerve degeneration, can be prevented through timely diagnosis and treatment. We characterize optic nerve photographs of 67,040 UK Biobank participants and use a multitrait genetic model to identify risk loci for glaucoma. A glaucoma polygenic risk score (PRS) enables effective risk stratification in unselected glaucoma cases and modifies penetrance of the MYOC variant encoding p.Gln368Ter, the most common glaucoma-associated myocilin variant. In the unselected glaucoma population, individuals in the top PRS decile reach an absolute risk for glaucoma 10 years earlier than the bottom decile and are at 15-fold increased risk of developing advanced glaucoma (top 10% versus remaining 90%, odds ratio = 4.20). The PRS predicts glaucoma progression in prospectively monitored, early manifest glaucoma cases (P = 0.004) and surgical intervention in advanced disease (P = 3.6 × 10− 6). This glaucoma PRS will facilitate the development of a personalized approach for earlier treatment of high-risk individuals, with less intensive monitoring and treatment being possible for lower-risk groups.