The play begins with a monologue by Wong, the water seller. He explains to the audience that he has heard that a few of the highest-ranking gods are on their way to the city of Setzuan. They have heard the people of the world complaining about life, so they are coming to deal with it. He is waiting at the gate of the city to greet them when they arrive. Soon, the three gods appear and Wong recognizes them immediately. He tries to find them a place to stay, but everyone keeps rejecting them. Finally, Shen Te the prostitute agrees. Before they leave the next morning, she asks them how to live a good life and still make ends meet; they have no answers. She complains to them that she cannot afford to live, so after conferring with each other, the gods decide to give her money. They explain they are only paying their "hotel bill," and then they leave.
Scene 1 begins with a monologue by Shen Te, explaining to the audience that after the gods gave her money, she bought a tobacco shop from Mrs. Shin. Mrs. Shin enters and demands that Shen Te give her some rice and money; by the end of the scene, Shen Te has been made to feel guilty and help an entire family in addition to Mrs. Shin. A carpenter enters and demands a hundred silver dollars for the shelves he installed in the shop while Mrs. Shin owned it. When Shen Te asks him to have patience, he starts to take the shelves back. The wife suggests that Shen Te let her "cousin" settle the affair when he arrives, inventing the character of Shen Te's cousin on the spot. Mrs. Mi Tzu, the landlady, demands references from Shen Te, and since Shen Te has none, she goes along with the wife's lie about her cousin who does not exist. She names him Shui Ta, and the wife, husband, and nephew all chime in to support her lie. Scene 2 begins with the arrival of Shui Ta. It is just Shen Te disguised as a man. He fools the family that has been staying in the tobacco shop, even though they know they invented this character. He tells them to leave, and bargains with the carpenter about the price of the shelves and with Mrs. Mi Tzu about the rent she is demanding.
As Scene 3 begins, Yang Sun, described as "a young man in rags," is contemplating hanging himself in a park. He is an unemployed pilot. Shen Te enters and notices that he is about to hang himself with a rope. It starts to rain, and Shen Te takes shelter under the tree with him; they are immediately infatuated with each other. In Scene 3a, Wong is asleep in the sewer pipe where he lives. The gods appear to him and he reports that he has seen Shen Te and that she is still good; she proved it to him when she bought his water even though it was raining. He tells the gods that Shen Te loves someone (presumably Yang Sun) and that she is "doing good deeds all the time." However, it is clear to the gods that her good deeds are unsustainable. When Wong tells them about her "cousin," Shui Ta, they get angry that he has not paid the carpenter what he owes and say he must never visit Shen Te again.
Scene 4 begins with an altercation between Mr. Shu Fu, the barber, and Wong, who has been trying to sell water to Shu Fu's customers. Shu Fu chases Wong out of his shop and hits his hand with a hot curling iron, burning it badly. Many people witness it, but when Shen Te returns and asks if they will be witnesses for him, they say no. The old woman who owns the carpet shop next door with her husband offers to loan Shen Te two hundred silver dollars so she can pay her rent. Mrs. Yang, Yang Sun's mother, enters and tells Shen Te that her son has been offered a job from the director of the airfield in Peking, but that he needs to pay five hundred silver dollars for it. Shen Te pledges to try to help Yang Sun. In Scene 5, Yang Sun enters and interacts with Shui Ta, having no idea he is actually talking to his lover, Shen Te. He demonstrates that he has no interest in Shen Te's financial well-being or her ability to pay the old couple back; he just wants to get to Peking to fly again. After Shui Ta has agreed to sell the tobacco, Yang Sun reveals that his plan is to betray Shen Te. Mr. Shu Fu enters and tells Shui Ta that he would like to offer Shen Te the run of some cabins on his property and other gifts so that she can continue being kind to everyone. Wong and the policeman enter, and Shui Ta betrays Wong (but tells the truth) in saying that his cousin was not present at the time of the assault with the curling iron. Yang Sun returns and Shu Fu tells him that he and Shen Te are about to announce their engagement. Just then, Shen Te emerges from the back room. When Yang Sun reminds her of how he loves her, she chooses to ignore the horrible things he said about her, and agrees to marry him. In Scene 5a, Shen Te explains to the audience that the old woman had to ask for her two hundred silver dollars back, since the anxiety of having loaned them made her husband ill. She said she would.
Scene 6 is set in "the 'private dining room' on the upper floor of a cheap restaurant in a poor section of town." Shen Te is there with her wedding guests. Yang Sun and Mrs. Yang, his mother, are removed from the crowd and have a secret conversation in which Yang reveals to his mother that Shen Te has said she cannot sell the shop for him because of the loan from the old couple; he doesn't want to marry Shen Te now. Without the rest of the money, Yang Sun will not marry her. They decide to wait another fifteen minutes for Shui Ta. At this point, Shen Te tells Yang Sun that Shui Ta will not bring the three hundred silver dollars, since he told her that Yang Sun bought only one ticket to Peking, revealing that she knows about the conversation he had with her "cousin" the day before. Yang Sun shows her two tickets; he tells her that they will have to leave his mother behind. However, the wedding has been postponed too long and the priest leaves, followed by all the other wedding guests. In Scene 6a, the gods visit Wong in a dream again, and he asks them to intervene in Shen Te's life. They refuse.
As Scene 7 opens, Mrs. Shin and Shen Te are taking the washing off the clothesline. Mr. Shu Fu enters and hands Shen Te a blank check, explaining that he wants to support her so she can continue being good. Shen Te feels her belly and realizes that she is, in fact, pregnant. Wong enters with one of the carpenter's starving children. Shen Te reveals to Wong that she is pregnant, but asks him not to tell Yang Sun. The wife and husband who had previously taken advantage of Shen Te enter dragging tobacco sacks; Shen Te agrees to put them in the back room. Shen Te leaves and returns dressed as Shui Ta. Shui Ta says that all the people may only stay in Shu Fu's cabins if they work for Shen Te. Mrs. Mi Tzu enters and Shui Ta tells her that he has decided not to sell the shop after all. As Shui Ta leads the group of new workers back to Shu Fu's cabins, Mrs. Shin realizes that Shen Te and Shui Ta must be the same person. Scene 7a takes place in Wong's sewer. He tells the gods that he has had a nightmare about Shen Te and asks them to help her, but they refuse, saying that helping Shen Te would only create more problems and would be too much work for them.
Time has passed before the beginning of Scene 8; Mrs. Yang reveals this to the audience, explaining that Shui Ta has given her son new motivation and a job in the tobacco factory. By now, he has been promoted to foreman. More time has passed before Scene 9, 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.
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 would not discover her pregnancy. Shui Ta goes into the back room and sobs loudly; Yang Sun overhears it and thinks that it is Shen Te. This eventually leads to Shui Ta's arrest concerning Shen Te's mysterious disappearance. Scene 9a takes place in Wong's den. The gods visit him there for the last time; they are clearly distressed and fatigued. 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. After testimonies for and against him, 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 did not 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 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. So 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.