SAN FRANCISCO -- Opponents have figured out how to hit San Francisco Giants right-hander Tim Lincecum.
Now they need to find a way to score against him.
Lincecum ran his streak of consecutive scoreless innings at AT&T Park to 27 on Friday night, shutting out the Arizona Diamondbacks on three hits in seven innings in a 5-0 win.
Third baseman Pablo Sandoval had three hits, including his 11th home run of the season, and three RBIs, highlighting a 10-hit attack that allowed the Giants to win at home for just the fifth time in their last 20 games.
Lincecum has been on the mound on three of those occasions and hasn't allowed a run in any. That includes his no-hitter against the San Diego Padres on June 25.
"Confidence has carried me," the former two-time Cy Young Award winner said. "I'm not afraid to throw any of my pitches in any situation."
Sandoval's homer, a two-run shot in the first inning off right-hander Mike Bolsinger (1-6), ended a run among Diamondbacks starting pitchers of not having allowed a home run in 42 consecutive innings.
The home run was just the Giants' 15th in their last 31 games.
That was all the offensive support that Lincecum and two relievers needed en route to the Giants' eighth shutout of the season.
"Scoring in the first couple of innings, that's always a good thing for us," said Sandoval, who had been slumping (12-for-his-last-54) entering the game.
In fact, the Giants are now 38-11 this season when they score first and 37-15 when they hit at least one home run.
Lincecum (9-5) has been involved in three of the Giants' eight shutouts in his last four starts, a stretch during which he has allowed just one run and 10 hits in 30 1/3 innings.
His string of consecutive shutout innings at home is the longest for a Giants pitcher in 12 years.
"I've been beneficial of being in games when we've scored runs," Lincecum said. "And I've been doing a good job limiting runs."
In beating the Diamondbacks for just the ninth time in 19 career decisions, Lincecum gave up doubles to third baseman Martin Prado and catcher Miguel Montero in the second and fourth innings, respectively, and a seventh-inning single to left fielder Mark Trumbo. He stranded all three on second base.
Trumbo was playing for the first time since suffering a stress fracture in his left foot on April 21. He was activated off the disabled list Friday, started in left field and went 1-for-4.
"He looked good. It looks like he's moving good," Diamondbacks manager Kirk Gibson said of Trumbo. "It's good to have him back in the lineup."
Lincecum walked two and struck out six, lowering his ERA, which stood at 4.90 before his no-hitter, to 3.66.
"There was a good, low strike zone tonight, and he made good use of it," Gibson said. "He made us chase. He took advantage of our aggressiveness."
Right-hander Juan Gutierrez and lefty Jeremy Affeldt combined for two innings to complete the shutout, allowing two hits.
First baseman Brandon Belt reached base three times, twice on singles, and scored a run for the Giants, who outhit the Diamondbacks 10-5.
Bolsinger gave up one run in 7 2/3 innings the first time he saw the Giants last month. But he was over that number three batters into the rematch, thanks to Sandoval's first-inning blast into the right-field pavilion that also scored Belt, who had singled.
The Giants doubled the advantage to 4-0 in the second inning. Lincecum helped his own cause with a run-scoring bunt on a safety squeeze after shortstop Brandon Crawford had driven in center fielder Tyler Colvin with an RBI single.
Sandoval added to his RBI total in the fifth inning, doubling in right fielder Hunter Pence to push the lead to 5-0.
Bolsinger was pulled for a pinch hitter in the sixth, having allowed five runs and eight hits in five innings. He walked two and struck out five.