SAN FRANCISCO -- A few minutes after Randy Johnson fell just short, Fred Lewis went long.
And though the Big Unit will have to wait for his next milestone victory, he was thrilled to see his struggling teammate get his first big hit in ages.
Lewis' heroics in his first start in a week seemed highly unlikely -- but so was the situation that put Lewis in position to help snap the Giants' three-game losing streak with his first homer since May 24.
Brandon Medders, who's been among the Giants' most dependable relievers all season, yielded Marlon Byrd's two-run double on the first pitch after he relieved Johnson, who was seeking his 302nd career victory.
Yet the Giants went back ahead thanks to Lewis, who looked overmatched while striking out in his first two at-bats. He hit a shot onto the arcade above the right field wall, and San Francisco's bullpen didn't waste this lead.
"I'm thankful I got a chance to get in there," Lewis said. "I haven't had much success, and I've been working behind the scenes to get my swing back. ... The first two at-bats, it was like the ball was coming at me 100 mph."
Aaron Rowand and Travis Ishikawa also homered for the Giants, who kept the Rangers winless in their last nine games in San Francisco.
The Giants' June surge was interrupted earlier this week by the Los Angeles Angels, who rolled to the first three-game sweep by an opponent in San Francisco this season. The Rangers' loss Friday night, coupled with the surging Angels' 5-4 win over the Dodgers, pulled the Angels within a half-game of Texas atop the AL West standings.
"It was a good win after playing the Angels for three games," Johnson said. "We were thinking, 'If they're the second-place team [in the AL West], what's the first-place team like?' It was nice to get us back on the right track."
In his 600th career start, Johnson had five strikeouts in another solid outing at home, where he has picked up five of his six victories this season -- all except career No. 300, which occurred in Washington. Sticking to his season-long tendencies, Johnson again gave up a handful of costly extra-base hits, but got inning-ending strikeouts with runners in scoring position three times in the first five frames.
"Randy did a good job of changing speeds and keeping us off balance, but as we got past that third inning, we began to figure him out," Texas manager Ron Washington said. "If we could have had that approach the first two innings, I think the game would have been different."
Michael Young homered for the Rangers, who haven't won in San Francisco since 1998, when the Giants still played at Candlestick Park.
Scott Feldman (5-2) allowed five runs on eight hits in his second straight loss after starting the season with five wins in eight starts. Rowand homered on Feldman's second pitch of the night, while Edgar Renteria and Bengie Molina hit run-scoring singles in the third to put San Francisco up 3-0 before Young connected for his 10th homer in the fourth.
Feldman overpowered Lewis in his first two attempts, but blamed himself for getting a bit too cute in the sixth.
"I went to the same pitch too many times," Feldman said of the sixth inning. "I think I just got a little too cutter-happy there. ... I was trying to be careful with [Lewis], because I don't need to get him out. I just need to get one out to get out of the inning. I wasn't even neccessarily trying to throw a strike, and I think I ended up leaving it over the plate a little bit. Just a bad pitch."
The Giants used five relievers to maintain their lead. Sergio Romo (1-0) was awarded the win after escaping a bases-loaded jam in the seventh, while Jeremy Affeldt pitched a perfect eighth before Brian Wilson picked up his 18th save in 21 chances.
Home plate umpire Bill Runge was hit in the mask by the barrel of Ishikawa's shattered bat in the sixth. Texas' medical staff briefly consulted with Runge before he continued the game. ... The Rangers' nine straight losses without a win at the Giants' waterfront ballpark are their most in any road park in club history. ... Omar Vizquel didn't play for Texas when he returned to San Francisco for the first time since spending the past four seasons with the Giants.