The production of prompt D + and Ds+ mesons is studied in proton-lead collisions at a centre-of-mass energy of sNN = 5.02 TeV. The data sample corresponding to an integrated luminosity of (1.58 ± 0.02)nb −1 is collected by the LHCb experiment at the LHC. The differential production cross-sections are measured using D + and Ds+ candidates with transverse momentum in the range of 0 < p T < 14 GeV/c and rapidities in the ranges of 1.5 < y ∗ < 4.0 and –5.0 < y ∗ < –2.5 in the nucleon-nucleon centre-of-mass system. For both particles, the nuclear modification factor and the forward-backward production ratio are determined. These results are compared with theoretical models that include initial-state nuclear effects. In addition, measurements of the cross-section ratios between D +, Ds+ and D 0 mesons are presented, providing a baseline for studying the charm hadronization in lead-lead collisions at LHC energies. [Figure not available: see fulltext.].