  The spectra of charged particles produced within the pseudorapidity window
abs(eta) < 1 at sqrt(s[NN]) = 5.02 TeV are measured using 404 inverse
microbarns of PbPb and 27.4 inverse picobarns of pp data collected by the CMS
detector at the LHC in 2015. The spectra are presented over the transverse
momentum ranges spanning 0.5 < pt < 400 GeV in pp and 0.7 < pt < 400 GeV in
PbPb collisions. The corresponding nuclear modification factor, R[AA], is
measured in bins of collision centrality. The R[AA] in the 5% most central
collisions shows a maximal suppression by a factor of 7-8 in the pt region of
6-9 GeV. This dip is followed by an increase, which continues up to the highest
pt measured, and approaches unity in the vicinity of pt = 200 GeV. The R[AA] is
compared to theoretical predictions and earlier experimental results at lower
collision energies. The newly measured pp spectrum is combined with the pPb
spectrum previously published by the CMS Collaboration to construct the pPb
nuclear modification factor, R[pA], up to 120 GeV. For pt > 20 GeV, R[pA]
exhibits weak momentum dependence and shows a moderate enhancement above unity.
