Roy made 162, the second-highest score by an England batsman in an ODI.
It led England to 308, their second-highest successful ODI chase, with 11 balls to spare in a match reduced to 42 overs because of rain at The Oval.
Sri Lanka posted 305-5, a total increased by the DLS method, but could not stop England taking a 2-0 lead.