The Red Sox won for the eighth time in 11 games despite being outhit by the Rays 6-5.
Alfred Aceves (3-1) went six innings to get the win, allowing a run on four hits with four walks.
Bailey gave up a leadoff single to James Loney in the ninth, but retired the next three batters to record his seventh save.
Nava's home run came off Chris Archer (1-2), who struck out seven in his four innings of work. Archer retired the first two batters in the third before giving up a single to Jacoby Ellsbury and Nava's ninth home run of the year.
Tampa Bay's run came on a sixth-inning homer from Evan Longoria, his 13th.
Pistorius testifies he didn't consciously pull trigger when he shot girlfriend
Pot vending machine to debut