Tim Lincecum and David Price pitched as expected against struggling lineups. Then, with the former Cy Young Award winners out of the game in the 10th inning, the San Francisco Giants couldn't get anybody out.

Wil Myers drove in the winning run with a bases-loaded single off Jean Machi, who had walked the first three hitters he faced, lifting the Tampa Bay Rays to a 2-1 victory over the Giants on Saturday night.

In ending a three-game winning streak, the Giants couldn't cash in two good scoring chances off Price late in the game and one in the 10th inning off Fernando Rodney.

"It was a hard fought game. We saw some good pitching," Giants manager Bruce Bochy said. "We had a couple missed opportunities and that was the difference in the game."

Lincecum allowed one run, six hits, one walk and had five strikeouts in seven innings. The right-hander was making his third start — the previous two were losses — since throwing a no-hitter at San Diego July 13.

Price gave up one run, five hits and struck out five in nine innings. In seven starts since returning from a left triceps injury, the Rays left-hander has allowed just 10 runs, 38 hits, one walk, and struck out 40 over 57 1-3 innings.

"We know we were up against some good pitching and we knew we had to make something happen, but you don't go out there thinking: 'I've got to pitch against Price, I've got to be perfect," Lincecum said. "You have to be perfect regardless of who I'm pitching against so it wasn't any added pressure."

Rodney (4-2) allowed two hits during a scoreless 10th, striking out Brandon Crawford with two on and two out after Hunter Pence's leadoff double.

The Giants failed to score in the fifth after Joaquin Arias drove a double off the wall with a man on base, and again in the eighth after Jeff Francouer's leadoff double.

San Francisco's only run came in the third when Francouer led off with the first hit off Price, moved up on a ground ball and scored on Crawford's chopper up the middle.

The Rays, who have scored only three runs in their last three games, won it after Desmond Jennings drew a leadoff walk in the 10th off Machi (2-1) and stole second. Ben Zobrist was intentionally walked and Evan Longoria walked to load the bases on four pitches before Myers won it on his liner over the left fielder's head.

It was the first walkoff hit of Myers' 38-game career.

"I think the biggest thing about the game was Rodney coming in and closing the door after that leadoff double, and especially Desmond getting that leadoff walk," Myers said. "I think that really set the game up."

The Rays' only run off Lincecum, which tied the game in the third inning, was another source of Giant frustration.

Jose Molina walked to open the inning and went to second on a wild pitch. When Kelly Johnson hit a bouncer to first baseman Brett Pill, Lincecum went over to cover first base and ran into Pill, enabling Johnson to beat out a hit.

"We just got kind of tangled up over there," Lincecum said. "I can see that he wanted to cover first on his own, and I was just kind of in the way of that."

Zobrist drove in Molina with a ground ball, the only run the Rays got until the 10th inning.

Giants catcher Buster Posey made a nifty play in the fourth on Myers' infield single. He chased down an errant throw by the first-base dugout and threw out the speedy rookie as he tried to reach second.

Longoria went 0 for 3, including three strikeouts and two walks, and is hitless in his last 17 at-bats. He hit just .194 in July, a month the Rays went 21-5.

NOTES: Giants RHP Ryan Vogelsong (fractured right hand) will make his fourth appearance with Double-A Richmond Sunday and is nearing a return to the rotation. ... Left-handed hitting Giants 1B Brandon Belt, who had three hits in Friday night 4-1 win after three games off for a mental break and to work on his swing, was not in the lineup with Price starting.