Boston scored all of its runs in the ninth after trailing, 5-0, through 8 ½ innings.
The winner was J.C. Romero (1-0).
Boston starter Josh Beckett yielded two earned runs and two hits in four innings before leaving with an injury to his right middle finger. He walked two batters and fanned seven.
Five players drove in one run each for the Orioles, who have lost two in a row after a three-game winning streak.
Jeremy Guthrie gave up an unearned run and three hits in 8 1/3 innings.
Ray fell to 3-3.