The former starting pitcher turned reliever entered Tuesday's 5-2 win in the seventh inning. He got the final out of the frame before returning for an eighth inning appearance. Martinez began that inning by walking Chris Taylor. He then forced Yasiel Puig to ground into a double play, before walking Enrique Hernandez.
Pederson walked up to the plate with two outs in the bottom half of the frame. Martinez tossed in a 96.1-mph fastball. Pederson hacked at the pitch and sent it blistering straight up the middle of the field.
Martinez could not get his glove up in time. He was still in the middle of his followthrough from the pitch, when the ball drilled him on the right side of his chest. The ball rolled toward first base as Martinez bent over and fell to the ground in pain.
His Cardinals teammates kept playing and managed to throw out Hernandez at second base for the final out of the inning.
Martinez was then tended to by trainers before walking off the field under his own power.
"I couldn't breathe, and everything started to go black," Martinez told reporters. "I took a couple of breaths, and after that, like a minute [later], it was better."
Martinez was removed from the 10-day disabled list hours before the victory. X-rays came back negative after Tuesday's unlucky collision. He told the St. Louis Post-Dispatch that he was doing well after the sequence.
"That was scary obviously," Cardinals manager Mike Shildt told Fox Sports Midwest. "All things check out right now."
Martinez is 6-6 this season with a 3.36 ERA in 19 appearances for the Cardinals. The two-time All-Star posted a 12-11 record with a 3.64 ERA in 32 starts last season in St. Louis.