Bergesen (1-4) picked up his first victory since last Sept. 21 at Boston. The right-hander entered 0-5 with a 9.13 ERA in five career starts against Tampa Bay.
Baltimore took a 4-0 lead when Fox hit a two-run shot in the sixth off Wade Davis (4-3). Mark Reynolds also homered for Baltimore, which improved to 18-20 this year. The Orioles didn't reach 18 victories last season until June 15, when their record was 18-47.
The Rays were held hitless after Sam Fuld's one-out single during the third.
Tampa Bay had runners on first and third with one out during the first, but Bergesen got out of trouble by getting a double-play grounder from Evan Longoria. The Rays had a runner reach third in each of the first three innings, but failed to capitalize.
Reynolds made it 2-0 with a solo homer in the fifth, but Baltimore missed out on a chance for a big inning when Luke Scott lined out to right with the bases loaded and two outs.
Vladimir Guerrero put Baltimore up 1-0 on a first-inning RBI double. After Adam Jones hit a run-scoring single in the seventh, Derrek Lee extended the Orioles' advantage to 6-0 when he drove in a run with a double one inning later.
Davis gave up four runs and seven hits in 5 1-3 innings. The right-hander had gone 4-0 over his previous five starts.
Baltimore leadoff hitter Brian Roberts, mired in a 2-for-35 slide, had two hits in five at-bats. Manager Buck Showalter hasn't considered taking Roberts out of the top spot, saying before the game that the second baseman is the best option and will continue to hit there.
NOTES: Tampa Bay CF B.J. Upton was back in the lineup after a two-game suspension for his tirade after he was ejected May 4. ... Baltimore RHP Justin Duchscherer (strained left hip) is expected to throw three innings at extended spring training in four or five days. He had a two-inning outing on Friday. ... Rays manager Joe Maddon said DH Johnny Damon will play in the outfield once during a three-game interleague series next weekend at Florida. ... Orioles C Matt Wieters was rested.