Cain left his previous start against the Colorado Rockies last Wednesday when he felt a twinge in his hamstring on the last pitch of the third inning.
Cain tested the hamstring out in a bullpen session Saturday, but manager Bruce Bochy said after the game that Cain will not start make his scheduled start on Monday against the Chicago Cubs.
Yusmeiro Petit will start in Cain's place.
Cain's Wednesday start was his third since returning from the disabled list on May 10. He missed one turn in the rotation because of a cut on his right index finger.
Cain is 1-3 with a 3.66 ERA in eight starts this season.