Joel Peralta (0-1) retired Boston's first two batters in the bottom of the ninth before walking Dustin Pedroia. Napoli then hit a liner off the left-field wall and Pedroia easily beat the throw home.
The Red Sox had lost all three of their previous traditional morning games against Tampa Bay on Patriots' Day and Jackie Robinson Day around the majors.
All uniformed personnel wore the number 42 on their uniforms in recognition of Robinson, marking the 66th anniversary of his breaking the Major League Baseball color barrier with the Brooklyn Dodgers.
The Red Sox had taken a 1-0 lead in the first on a leadoff triple by Jacoby Ellsbury and an RBI-groundout by Shane Victorino. Evan Longoria tied it in the fourth with his first homer of the season before Jarrod Saltalamacchia led off the fifth with his second.
Both starters were outstanding. Boston's Ryan Dempster struck out 10 and allowed two hits and two walks in seven innings. Tampa Bay's Jeremy Hellickson also worked seven innings, giving up two runs, three hits and one walk while striking out nine.
Koji Uehara pitched a perfect eighth for Boston before Bailey tried for his first save this season. He filled in for Joel Hanrahan, who struggled as Boston's closer before being sidelined for a few days with soreness in his right hamstring.
Until the ninth inning, the Rays were 11 for 88 in the series, a .125 batting average. And they had been in an 0-for-22 stretch with runners in scoring position. But Bailey blew the save opportunity before retiring the last three batters of the inning, two on strikeouts.
Tampa Bay fell to 1-5 on its nine-game road trip, while Boston won its third series in the four it has played this season. The sweep was its first since it won three games against the Miami Marlins from June 19-21 last year. The Red Sox ended the season in last place in the AL East with a 69-93 record but leads the division at 8-4 under John Farrell, who replaced the fired Bobby Valentine as manager.
On Sunday, Clay Buchholz pitched seven no-hit innings and had a career-high 11 strikeouts in a 5-0 win in which the Rays finished with three hits.
Dempster followed that with another outstanding performance. Tampa Bay's only hits against him were a bunt single leading off the second by Matt Joyce, who was erased on an inning-ending double play, and Longoria's two-out homer in the fourth.
It ended Longoria's longest season-opening stretch without a homer at 11 games and was just the fifth homer by the Rays. But Longoria has reached base in every game this season.