SAN FRANCISCO -- Bengie Molina either gave the Giants something to remember him by or whetted their appetite for more heroics.

The alternatives were established Tuesday night as Molina belted two home runs among his four hits and four RBIs to help San Francisco subdue the Arizona Diamondbacks, 8-4. The answer regarding Molina's future with the Giants must wait until the offseason, when he takes his expected plunge into free agency.

Molina was virtually matched by Pablo Sandoval, who also collected four hits and lined his team-high 23rd homer. They combined to drive in six runs. The Giants can relax regarding Sandoval, who won't be eligible for free agency for another five years.

Molina's a much more pressing issue. And there's no easy solution. Consider the scenarios:

Molina, who left the clubhouse before reporters gained access and wasn't available for comment, probably will want a multiyear deal with an average annual value of at least $6 million, given the three-year, $16 million package he signed with the Giants. At 35, he might find few teams willing to offer him more than a two-year contract. But given the shortage of quality catchers and Molina's respectable offensive production, anything's possible.

As for the Giants, it has been speculated that they won't offer Molina more than one year plus an option for a second season, given Buster Posey's presence as the catcher of the future. The possible departures of free agents such as Randy Winn, Randy Johnson, Bob Howry and Noah Lowry conceivably give the Giants some financial wiggle room. But they won't have much spare change once they finish paying Tim Lincecum and Brian Wilson, who will become eligible for salary arbitration for the first time.

Yet the Giants are unlikely to entrust the No. 1 catcher's job next year to Posey, who has barely more than one season of professional experience. If the Giants don't re-sign Molina, they'll have to find some sort of veteran journeyman who's proficient enough to play most of the time while helping Posey develop. But this sort of caretaker probably wouldn't be capable of hitting 18 home runs and amassing 85 RBIs, which has been Molina's annual average during his three Giants seasons.

The Giants' second victory in a row preserved their faint postseason hopes. They trail National League Wild Card leader Colorado by five games with five to play.

"We're still breathing," Giants manager Bruce Bochy said. "There's a little hope, but not a lot."

Bochy added, "We wouldn't be breathing with five games left without Bengie."

Bochy said that he and Molina had a long talk a couple of days ago about the latter's impending free agency. While reminding Molina of the quality of his efforts for the Giants -- "He's done a terrific job," Bochy said -- the skipper reminded him not to dwell on the future before this season ends.

"We can't get caught up in what happens next year," Bochy said.

Particularly since what awaits Molina and the Giants this offseason is so uncertain.

"We don't know what's going to happen," Bochy said. "It's something you don't have control over."

Molina clearly reveled in his performance against the D-backs. His second homer, the tail end of a back-to-back power display with Sandoval in the seventh inning, was his career-high 20th, eclipsing the 19 he hit for Toronto in 2006 and San Francisco in 2007. After crossing home plate, Molina raised both arms to the sky and clenched his fists.

It was a resurgent evening for Molina, who missed the previous three games with a sore left hand. His teammates have grown accustomed to this sort of thing.

"Hopefully he gets back here with us and helps us like he has the last three years," said left-hander Jonathan Sanchez (8-12), who yielded two home runs to Miguel Montero but experienced little trouble with the other D-backs in his 5 2/3-inning outing. Sanchez defeated the D-backs for the second time in a week and improved to 3-1 against them this season.