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.
It is a third one-day series win in five since the awful World Cup campaign of 2015. The two defeats, against Australia and South Africa, were both in deciding rubbers.
Sri Lanka are still searching for their first win over England on this tour, with only Saturday’s fifth ODI at Cardiff and a Twenty20 in Southampton on Tuesday remaining. (Courtesy BBC Sport)