Mark Reynolds also homered and drove in four runs, and DJ LeMahieu had his fifth four-hit game of the season for the Rockies.
Gerardo Parra added three hits and four RBIs for the Rockies, who finished the night one run shy of their season-high.
Gray (5-2) allowed two runs and five hits to win for the second time in three starts this month.
Leading 6-0, the Rockies broke the game open with a five-run fourth. Para's one-out single put runners at the corners and chased Mike Foltynewicz (10-8). Reynold's hit Luke Jackson's first pitch over the center-field wall for his 25th home run and Story had a two-run shot later in the inning.