More time has passed, and now Shui Ta is quite fat (because Shen Te is pregnant). Mrs. Shin tells him that the old couple has lost the carpet shop because the repayment of the 200 silver dollars came too late. Then she reveals to Shui Ta that she knows he is the same person as Shen Te, and that "he" is pregnant. As she comforts "him," Yang Sun enters and reveals that the police want to shut down the shop because they have over twice the lawful number of workers living in Shu Fu's cabins.
Wong enters and reveals that it has been six months since Shen Te has been at home. In front of Yang Sun, he tells Shui Ta that Shen Te is pregnant. Shui Ta leaves and Yang Sun assumes that Shui Ta has sent his cousin away so that Yang Sun wouldn't discover her pregnancy. Shui Ta goes into the back room and sobs loudly; Yang Sun overhears it and thinks that it's Shen Te. When Shui Ta returns, Yang Sun accuses him of locking Shen Te up in the back room. When Yang Sun leaves, Shui Ta gathers Shen Te's clothes from the back room.
Mrs. Mi Tzu enters with Mr. Shu Fu, and Shui Ta has to hide Shen Te's clothes under the table. Shu Fu complains that Shui Ta is taking advantage of his kindness toward Shen Te, but Shui Ta tells him that Shen Te is about to return. Then Shui Ta tells Mrs. Mi Tzu that he wants to buy half of her property, and she wants to give it to him in exchange for Yang Sun. At that point, Yang Sun enters with the policeman. The policeman looks in the back room for Shen Te, but finds it empty. Yang Sun discovers Shen Te's clothes under the table and rumors begin that Shui Ta has murdered his cousin. The policeman leads him away.
Scene 9a takes place in Wong's den. The gods visit him there for the last time; they are clearly distressed and fatigued. They have given up all hope of finding another good person in the world; they conclude that the people of the world are "a worthless lot" and that they are "too weak." Then they set off to find Shen Te to make sure she stays good. She is their only hope.
Chapter 10 is set in a courtroom. The policeman introduces the judges, who are the three gods. They are nervous that they will be caught posing as judges. Shui Ta recognizes them and nearly falls over. He pleads not guilty to "doing away" with his cousin Shen Te. The policeman, Mr. Shu Fu, and Mrs. Mi Tzu all testify in favor of Shui Ta. In contrast, the people the policeman calls "riff-raff" testify against him. Surprisingly, Yang Sun speaks up for Shui Ta and says that although he may have taken advantage of many poor people, he is not a murderer. Yang Sun says he heard Shen Te's voice in the back room of the tobacco shop, so he knows she is still alive.
Wong says that Shui Ta has spoiled the tobacco shop, which was meant to be "a fountain of goodness." When he raises his right hand to swear that Shen Te was a good person, the gods notice his injury. He blames it on Shui Ta, since Shen Te was going to help him go to a doctor but Shui Ta refused. Shui Ta begins to cave in and tells the judges to clear the courtroom so he can make a confession.
When the courtroom is cleared, Shui Ta reveals to the gods that he recognizes them and that he is, in fact, Shen Te. After she has explained why she had to take these measures, the first god chooses to be in denial about it. He says that Shen Te is still good, though the other two gods insist that he didn't hear a word she said and that he is ignoring the fact that she committed bad deeds while disguised as Shui Ta.
The gods exit, singing the "Valedictory Hymn" and ignoring Shen Te's pleas to stay. The people reenter the courtroom and realize that the judges were the gods, and they are in awe at Shen Te's reappearance. She yells after the gods that she still needs her cousin's help, and they agree that he can come back once a month. They make their final exit, singing "The Trio of the Vanishing Gods on the Cloud" as Shen Te's cries for help interrupt them.
Brecht added the epilogue after the rest of the play; it can be spoken either by Shen Te or by Wong. In the epilogue, it is acknowledged, "A nasty ending was slipped up on us"; the play has ended with no satisfactory conclusion and it must be frustrating to the audience. Therefore, the audience is implored to "write the happy ending of the play!" They must figure out for themselves how to reconcile goodness in a world where it apparently cannot exist.
It is clear in Scene 9 that Shui Ta has let economic success get the best of him. He is called "The Tobacco King of Setzuan," since he has continually expanded the small tobacco shop into a huge factory system. He has turned Shen Te's "goodness," which was a weakness, into economic success, which is a strength. This value is in accordance with the theme of Historical Materialism. The theme of Historical Materialism is evident in Scene 10, when Mr. Shu Fu testifies on behalf of Mr. Shui Ta. He tells the judges, "Mr. Shui Ta is a businessman, my lord. Need I say more?" The first god answers, "Yes." This is because economics make no sense to the gods; it is not their realm.
When the gods appear to Wong in Scene 9a, they reveal how little goodness they have found in the world. Shen Te is the only person who has "stayed good," and Wong draws attention the fact that she hasn't even done that. The third god concludes that, "Good intentions bring people to the brink of the abyss, and good deeds push them over the edge." The gods have discovered that it is impossible to be "good" in accordance with their rulebook.
When the courtroom has been cleared, Shui Ta reveals that he is just Shen Te, disguised. Shen Te then tells the gods, "Your injunction / To be good and yet to live / Was a thunderbolt." It was impossible for her to be good to others and herself at the same time. The first god refuses to hear that Shen Te did bad things disguised as Shui Ta, instead congratulating her for remaining good. They leave without changing anything; Shen Te still has the same problems and still will struggle to be good.
In Scene 10, music is used to drown out reason. The gods sing "The Valedictory Hymn" ironically, since there is no victory to be celebrated. They have not fixed anything about Shen Te's life. While they make their final exit, they sing "The Trio of the Vanishing Gods on the Cloud" in which they admit that "If we watch our find too long / It will disappear." They do not want to stay in case Shen Te proves to not be good after all; they would rather be ignorant of that change if it does happen, so they won't have to change their rule book.
The epilogue, which was added after the Viennese premiere of the play, implores the audience to write their own ending. It acknowledges that the current ending of the play is not quite satisfactory, since nothing is fixed. The gods are unable to accept that their rulebook must be changed in order to make it possible to be good in the world, and they leave in denial of Shen Te's situation. This technique of addressing the audience directly is an example of alienation, which forces the audience to see the play for what it represents rather than be caught up in it as an analogy for real life.