In Act III, John Proctor brings Mary Warren to the court to testify against the girls. He knows that her testimony should convince the court that the girls (especially Abigail) are lying and his wife is innocent.
While it seems like a good plan, it doesn't work well for Proctor. The courts are not willing to listen to his evidence. When the court brings Abigail and the other girls in to refute Mary Warren's testimony, Mary Warren turns on Proctor.
Screaming at him: No, I love God! I go your way no more! I love God, I bless God. sobbing as she rushes to Abigail. Abby, Abby, I'll never hurt you.
When it seems the girls will turn on her, Mary Warren flips on Proctor by saying that he has forced her to lie in court and that it is actually he, and not Abigail, who is doing the Devil's work.