The cross sections for gamma(1S), gamma(2S), and gamma(3S) production in lead-lead (PbPb) and proton-proton (pp) collisions at root s(NN) = 5.02 TeV have been measured using the CMS detector at the LHC. The nuclear modification factors, R-AA, derived from the PbPb-to-pp ratio of yields for each state, are studied as functions of meson rapidity and transverse momentum, as well as PbPb collision centrality. The yields of all three states are found to be significantly suppressed, and compatible with a sequential ordering of the suppression, R-AA(T(1S)) > R-AA(gamma(2S)) > R-AA(gamma(3S)). The suppression of gamma(1S) is larger than that seen at root s(NN) = 2.76 TeV, although the two are compatible within uncertainties. The upper limit on the R-AA of gamma(3S) integrated over p(T), rapidity and centrality is 0.096 at 95% confidence level, which is the strongest suppression observed for a quarkonium state in heavy ion collisions to date. (C) 2019 The Author(s). Published by Elsevier B.V.