Huff hit a pair of two-run homers, Cain powered his way to his fourth consecutive win and San Francisco beat the Oakland Athletics 6-2 on Sunday to complete a three-game series sweep.
"I already stole your thunder Cain," Huff joked as the pitcher spoke with reporters in the clubhouse.
"That's the answer to all your questions," Cain laughed in response.
Huff signed a one-year deal with the Giants in the offseason and got off to a sluggish start. He batted .247 with two homers in April but has been a tear since then, hitting .336 since May 1.
The veteran slugger, who had 15 homers with Baltimore and Detroit last season, has six homers and 13 RBIs over his last 16 games alone.
"The first month of the season I really tried to beat it and got in a lot of bad habits," Huff said. "I just got to a point where I stopped caring and just started seeing the ball and hitting it. If it goes, it goes. If it doesn't you take your doubles and triples."
The Giants, who were swept by the A's last month in Oakland, improved to 8-4 in June after scuffling to a 14-14 mark in May. They moved a season-high eight games over .500 and pulled within 1 1/2 games of first-place San Diego in the NL West.
The changes worked nicely.
Sandoval walked in the sixth and scored on Huff's ninth homer. Uribe, batting cleanup for only the sixth time this season, followed with a drive to left to make it 4-1.
Sandoval also walked in the eighth before Huff hit a 2-2 pitch from Craig Breslow over the wall in right for his 10th career multihomer game.
"We got shut down at their place and we certainly wanted to return the favor," Bochy said. "There's no getting around that. We wanted to get even with them and guys played well."
Cain (6-4) allowed one run and eight hits over seven innings. He is 4-0 with a 0.55 ERA in four starts since his last loss May 22 at Oakland, when the A's got an unearned run off the hard-throwing righty in a 1-0 victory.
"I'm just trying to get guys to swing early," Cain said. "I think I'm locating both sides of the plate a little better. That carries into being able to get other stuff working as well."
Jack Cust had three singles for Oakland, which dropped its sixth straight game at AT&T Park.
"We made too many mistakes," A's manager Bob Geren said. "There were some positive things but there were errors that led to runs. It wasn't a good series, it really wasn't. We had too many things go wrong in a three-game series to overcome."
Vin Mazzaro (2-1) pitched a season-best six innings for Oakland, yielding four runs, three earned, and six hits.
Cain ran his scoreless streak to 16 innings before Landon Powell hit a two-out RBI single in the fourth. Cliff Pennington then doubled to right but Powell was thrown out trying to score, ending the inning.
Cain pitched out of another jam in the sixth. With one out and runners at the corners, he struck out Adam Rosales and retired Powell on a bouncer to second.
San Francisco's bullpen nearly let Cain's latest gem get away. Reliever Dan Runzler's throwing error set up Kevin Kouzmanoff's RBI single in the eighth. Guillermo Mota then came in and walked two batters to load the bases before Santiago Casilla got pinch-hitter Mark Ellis to pop up for the final out of the inning.
Oakland 3B Eric Chavez (neck spasms) told manager Bob Geren he is not yet ready to begin his minor league rehab assignment. ... Giants 2B Freddy Sanchez got the day off. ... Kouzmanoff extended his career-high hitting streak to 14 games. ... The A's designated backup C Jake Fox for assignment, clearing the way for C Kurt Suzuki to return from the bereavement list.