Dan Uggla and Emilio Bonifacio each drove in a pair of runs for the Marlins, who have won four straight.
Sanchez (10-8) allowed three hits and one walk while striking out five. He is 3-0 with a 0.70 ERA in four starts against the Astros.
J.A. Happ (3-2) retired 10 straight before a 37-minute rain delay. He was charged with three runs in six innings and struck out six.
The Marlins led 3-0 in the seventh before Sanchez delivered a run-scoring single.
It was his first RBI in 103 at-bats since Sept. 11, 2006 against the New York Mets, a span of 103 at-bats.
The Marlins followed with three consecutive run-scoring hits as Ramirez and Bonifacio also had RBI singles followed by Gaby Sanchez's double that put Florida up 7-0.
Ross and Luna homered in the eighth off Fernando Abad. It was the third time this season the Marlins have hit back-to-back homers.
Notes: Marlins C Brett Hayes went 0 for 3 in place of Ronny Paulino, who was suspended 50 games Friday after he tested positive for a performance-enhancing substance under Major League Baseball's drug policy. ... Anibal Sanchez reached 10 wins for the first time since he went 10-3 as a rookie in 2006. ... Astros 1B Brett Wallace is hitless in 13 at-bats with eight strikeouts.