The 36-year-old American was competing at a major tournament for the first time in 16 months — and for the first time since giving birth to her daughter last September.
Sharapova wished Williams a speedy recovery and a rapid return to the tour in a two-sentence statement released by French Open organizers.
“I was looking forward to my match against Serena and am disappointed that she had to withdraw,” Sharapova said.
Williams said her chest began hurting in her third-round singles victory over 11th-seeded Julia Goerges on Saturday.
“It was really painful,” Williams said, “and I didn’t know what it was.”
Despite that, Williams played in a doubles loss alongside her older sister, Venus, on Sunday and tried to limit the pain by taping up the muscle. But nothing was effective enough that Williams thought she could continue in Paris.