The surprising Rays held off the Cubs 5-4 for their second straight win over the club with baseball's best record, while Chicago also lost starter Carlos Zambrano to a shoulder problem on Wednesday night.
"It validates that we are a good team," Rays manager Joe Maddon said of the win.
"When you go through these situations where you're attempting to grow -- you think you're good and you think you're better, but you actually have to go out there and show it. It's not about coming up short or always saying, 'What if.' You actually have to do it. We need confidence to do that, and we gain confidence with games like this."
Andy Sonnanstine allowed three runs in five-plus innings and Tampa Bay's improved bullpen shut down the Cubs for the second night in a row to help the Rays clinch their ninth consecutive series at home.
Zambrano (8-3) lost for just the second time in his last nine decisions. He allowed five runs and seven hits in 6 2/3 innings, departing after throwing 100 pitches. The Cubs later said he was lifted because of right shoulder discomfort.
The two-time NL All-Star will fly Thursday to Chicago, where he will see a doctor and have an MRI examination.
"At this point I don't know nothing. We'll see what happens tomorrow," Zambrano said, adding that his shoulder was feeling better. "Hopefully it's nothing bad."
Catcher Geovany Soto motioned for manager Lou Piniella to head out to the mound after Zambrano threw his last pitch.
"He threw a pitch funny. Like weird," Soto said. "I went out there. It was like, 'Are you alright? What's going on?' He said, 'Yeah, I'm fine.' I just had to call somebody because I didn't think it was alright."
Zambrano tried to make a case for staying in the game.
"He was convincing," said Piniella, who appeared to be ready to allow the pitcher to continue before changing his mind. "We did the right thing getting him out, obviously."
With 42 wins, the Rays have matched their club record for victories before the All-Star break. They were 42-45 at the break under Piniella in 2004 and wound up winning a franchise-best 70 games.
The Cubs scored twice in the third and once in the fifth off Sonnanstine (8-3), who allowed six hits and kept the Rays in front by only giving up one run after Chicago loaded the bases on a double and two walks with no out in the fifth.
Ryan Theriot, who drove in a run with a third-inning single, trimmed Tampa Bay's lead to 5-3 when he grounded into a force play at second. Sonnanstine avoided further damage when he struck out Derrek Lee and got Aramis Ramirez to fly out to strand runners at first and third.
The Rays' bullpen limited the Cubs to one run and three hits over the last 4 1/3 innings of Tampa Bay's 3-2 victory in the series opener. This time, J.P. Howell and Dan Wheeler held Chicago in check until Troy Percival closed it out in the ninth.
Percival earned his 17th save in 19 opportunities to tie Hall of Famer Rollie Fingers for ninth place on the career list with 341. He gave up a leadoff homer to Soto and walked Mark DeRosa to put the tying run on first before retiring the next three batters to end the game.
"We're a good team. Everybody knows we're a good team now," Percival said. "We're not sneaking up on anybody anymore."
Zambrano walked Akinori Iwamura leading off the first and third innings, and the right-hander paid for it both times.
Carl Crawford, back from serving a four-game suspension for his part in Tampa Bay's bench-clearing brawl at Boston on June 5, hit a liner that DeRosa tracked down in left field only to have the ball skip off his glove for a two-base error that allowed Iwamura to score all the way from first.
In the third, Crawford doubled after Iwamura walked, and Upton, Hinske and Longoria followed with RBI singles to put Tampa Bay up 4-2. One out later, Zambrano gave up a RBI single to Aybar to fall behind by three runs.
Kosuke Fukudome drove in Chicago's first run with an RBI double, then scored on Theriot's single for a 2-1 lead.
Fukudome batted leadoff for the first time. Piniella would like to keep the rookie there until LF Alfonso Soriano (broken left hand) returns from the disabled list. ... Cubs OF Reed Johnson sat out with back stiffness after a first-base collision with Rays 1B Aybar during the ninth inning Tuesday night. Piniella said Johnson was available in an emergency. ... Rays OF Rocco Baldelli (mitochondrial order) went 2-for-3 with a pair of solo homers in his second rehab start for Class A Vero Beach. ... Cubs OF Jim Edmonds left the game in the fourth inning with left foot soreness.
Information from The Associated Press was used in this report.