Graham was rolling along and appeared poised to become the first Marlins starter to win in two weeks when he turned a 5-2 lead over to his bullpen.
Instead, the drought continues.
Theriot, a slap-hitting shortstop, pulled Burke Badenhop's 0-1 pitch into the second row of the left-field bleachers to give Chicago a 6-5 lead. It was Theriot's first home rum of the year and only his eighth in 1,351 career at-bats.
Marlins pitchers have given up four grand slams so far this year.
It looked good in the early going as the Marlins jumped all over Rich Harden, who allowed five runs and six hits with four walks in less than four innings.
Three of his walks came in the fourth, when he also forced in a run by hitting Jorge Cantu with a pitch to put the Cubs behind 5-1.
Adding insult to injury, former Marlins closer Kevin Gregg gave up a ninth-inning run before getting Hanley Ramirez to fly out for his second save of the year.