ST. PETERSBURG -- Two successive wins against the Red Sox finished off a successful homestand for the Rays.

Home runs and pitching were the difference Wednesday night as the Rays took a 6-4 win with 31,517 watching at Tropicana Field.

"It feels good whenever you can beat those guys, especially when you can win all the games from them," Carl Crawford said. "We're trying to climb back up in the standings. We needed both of them."

The Rays (60-48) finished their nine-game homestand against the Red Sox, Royals and Yankees with a 6-3 mark while moving to 12 games over .500 for the first time this season.

By winning, the Rays maintained their position at 5 1/2 games behind the American League East-leading Yankees, while the Red Sox (62-44) dropped to 2 1/2 games out of the top spot as they head to New York to play the Yankees in a four-game weekend series.

A measure of just how far the Rays have come in the past two seasons rests in the fact that they are now 15-6 against the Red Sox since June 30, 2008. If the 2008 postseason is included, Tampa Bay is 19-9 in its past 28 games against Boston -- a vast improvement from the days when the Red Sox owned the series.

"We know it's going to be tough every time [we face the Red Sox]," Crawford said. "I don't know what it is against those guys -- we get up more against them, whatever the case may be, we seem to play well against them. I really don't want to analyze it too much. I just hope we keep doing well against them."

In addition, the Rays have now won 14 of their past 16 games against the Red Sox at Tropicana Field.

"I don't think any team likes coming in here, to be honest with you," former Rays outfielder Rocco Baldelli said. "I kind of got that sense throughout my career here. I haven't talked to too many guys in the league that say, 'I like playing at Tropicana Field.' No one says that. They all say that they don't like it, and I don't know, maybe it's just an uncomfortable place for people when they're not used to it."

All of the Rays' runs came via the long ball Wednesday night.

Carlos Pena began the onslaught with his 27th homer of the season, a two-run shot in the second off Brad Penny (7-6) that put the Rays up 2-1. Carl Crawford added a two-run homer in the third to give himself a present on his 28th birthday -- the third time he has done so on his special day.

"That's what everybody wishes for on their birthday when you gotta play a game," Crawford said. "For it to happen, I was definitely excited about it."

Pat Burrell and Jason Bartlett finished off the homer parade with solo shots in the sixth and seventh innings, respectively.

David Price gave the Rays his fourth quality start of the season by holding the Red Sox to two runs over six innings to move to 5-4 on the season.

"I threw a lot of first-pitch strikes -- puts the count in my favor," Price said. "I was 0-2, 1-2 a whole lot tonight. I wasn't behind in the count too much. It gets defensive swings. Maybe they make a mistake then because they're in defense mode. It works to my favor."

And when Price did fall behind, he didn't give away the free base.

"He had a 3-1 count on [Jed] Lowrie and [Lowrie hit] a line-drive base hit to left, and I love that," Rays manager Joe Maddon said. "I'd much rather see that line-drive base hit than a walk."

Dan Wheeler swooped in from the bullpen to put out a fire in the eighth after Jeff Bennett left the game with runners on second and third and no outs. Kevin Youkilis swung at Wheeler's first pitch and grounded out to score a run. Jason Bay then swung at Wheeler's second pitch of the inning and grounded out to short.

"I was just trying to cut the ball a little bit to see if I could get them to put the ball into the ground," Wheeler said. "Obviously with the guys I was facing, you had to be really careful because one swing of the bat, tie game. And that's really what I was focusing on, making a pitch down."

Wheeler then got some help from Bartlett when Mike Lowell hit a Texas leaguer to center field, and the Rays shortstop made a difficult over-the-shoulder catch to end the threat.

"I knew he didn't get it good, but those balls have been falling in," Wheeler said. "Jason made a great play. I was just hoping that he and Ben [Zobrist, the second baseman] didn't collide."

J.P. Howell came in to pitch the ninth. After walking pinch-hitter J.D. Drew to start the inning, the crafty left-hander struck out Jason Varitek and Lowrie before retiring Jacoby Ellsbury on a groundout to second to end the game and pick up his 12th save of the season.

"We've waited for [urgency] to arrive," Howell said. "Urgency, I think it's happened. I think we tried to kick-start it a month ago. And it's hard to do. You battle it and battle it, and sooner or later, you're on all cylinders. We like where we're at right now, but there's so much more to go."