Mary Warren initially went to the court to confess that she and the girls had been pretending. However, just as she had predicted at the end of Act Two ("They'll turn on me! I cannot!"), Abby and the girls did in fact turn on her. They cried out, insisting that Mary's familiar spirt came into the courtroom in the form of a yellow bird that was going to claw Abby's face. Judge Danforth immediately picks up on the cue, and asks Mary if she is a witch, and asks John if he is somehow forcing Mary to turn on the girls.
When Danforth suggests Mary will hang for being a witch, Mary finally caves, and turns on John, calling him a "Devil's man" (look at the very, very end of Act Three for the quotes you need) who had come to her with his black book to sign, and forced her to come to the courts to overthrow them. This is truly sad, as she was the last thread of hope that Proctor had for saving his wife and friends.