Matt Adams also homered as St. Louis won for the seventh time in nine games and kept pace with Pittsburgh. Both teams are 87-62 with 13 games remaining.
Miller (14-9) gave up one earned run and three hits in five innings. He became the first St. Louis rookie to reach 14 wins in a season since Dick Hughes won 16 in 1967.
Molina's second-inning homer off Erasmo Ramirez (5-2) snapped an 0-for-15 skid. Molina scored three times and raised his batting average to .317.