Updated

St. Louis right-hander Lance Lynn was at the top of his game on Wednesday night.

So was Tampa Bay right-hander Alex Cobb and the Rays beat the Cardinals 3-0.

Lynn gave up one earned run over 6 1-3 innings and continued a streak of four strong outings.

"Some nights you are going to get out-pitched," Lynn said. "That was my view of the game. You go out there and match up with someone and he beat me.

"That's baseball."

Lynn (11-7) has allowed just five earned runs over his last four starts covering 25 2-3 innings. He gave up six hits, struck out seven and walked three against Tampa Bay. Lynn left trailing 1-0.

"Lance did a great job," St. Louis manager Mike Matheny said. "He threw a lot of pitches (118), but he really fought to keep us there."

After giving up a run in the second, Lynn bounced back with four scoreless innings. He retired the first batter in the seventh before giving up a single to Desmond Jennings. Lynn then induced Ben Zobrist to hit a grounder to second that deflected off the glove of second baseman Kolten Wong for an error.

"It was a double play ball," Lynn said.

The bobble signaled the end of Lynn's night.

"I threw the ball well, I just gave up a couple too many (hits) with the way (Cobb) was throwing," Lynn said.

It was the Rays' seventh straight win.

Cobb (6-6) blanked the Cardinals on five hits over seven innings. It was the fourth time this season he has thrown at least seven innings without an earned run. Cobb missed 50 games last season with a concussion after he was hit near the right ear by a line drive off the bat of Kansas City's Eric Hosmer.

"Tonight was the best I've felt on the mound hands down since I've come back and even before that," Cobb said. "When my mechanics are right, all my pitches play off each other."

Jake McGee pitched the ninth inning for his ninth save in 10 opportunities.

The Rays have won 25 of their last 36 games and are 13-4 in July. On June 29, they had the worst record in the majors and have passed 11 teams since.

Tampa Bay completed its road trip at 5-0 and its eight-game road winning streak ties the franchise record set twice. The loss was the third straight for the Cardinals.

"We played well. We had a great vibe in the dugout," Tampa Bay manager Joe Maddon.

Cobb picked up his first career hit in eight at-bats when he doubled down the first base line with two outs in the second inning to give Tampa Bay a 1-0 lead.

"That was the coolest thing I've done in my big league career," Cobb said. "I was kind of secretly hoping it was going to be a 1-0 win."

The Rays added a run in the ninth on an RBI single by Guyer.

After the first inning Cardinals third base coach Jose Oquendo left two packages of crackers for Tampa Bay catcher Jose Molina on home plate. They were from Cardinals catcher Yadier Molina, who is on the disabled list with torn ligaments in his right thumb.

Matheny took the blame for losing track of the count on a plate appearance by Jon Jay in the seventh. Jay appeared to take ball four, but the scoreboard read 2-2. Jay questioned home plate umpire Dan Bellino, who agreed with the scoreboard.

Jay eventually struck out.

"I missed it," Matheny said. "He looked back, he thought it was ball four. I just missed it. That was huge. It would have put the tying run at the plate. It was a big part of the game."

Jay still isn't sure what took place.

"I don't even know what happened," Jay said. "I asked, but the board said 2-2."

NOTES: Rams Pro Bowl P Johnny Hekker threw out first pitch. ... Cobb's hit was the first by a Rays pitcher this season. ... The Cardinals activated P Kevin Siegrist from the 15-day DL. He missed 52 games since May 24 with a left forearm strain. St. Louis optioned P Nick Greenwood to Triple-A Memphis.