Polly and Lucy come, obviously distraught. Macheath advises them to find themselves new husbands in the West Indies (thus setting up the way for the sequel Polly , which, however, was banned from being performed by censors). Polly, Lucy and Macheath sing a trio about how sad they are: the ladies wish they would be hanged together with Macheath and Macheath is sad because his “courage is out”, i.e. the bottle is empty. They say their adieus and when the jailer brings four more wives of Macheath, with a child each, Macheath is quite ready to be hanged. At this point Gay breaks the action for some metacommentary: the Player remonstrates with the Beggar, the author of the play, that it cannot end, like the Beggar wants, with Macheath being hanged and the rest of characters probably either hanged or transported. But the Player tells him that “an opera must end happily”. This was indeed the case long after The Beggar’s Opera: over 30 years later Christopher Willibald Gluck, generally hailed as the great reformer of opera, the one who made the music fit the lyrics etc., couldn’t break the convention when composing his Orpheus and Eurydice) and had to tack on a happy end, with Amor popping up and saying “yeah, we told you not to look back and you did, but you sang so nicely, we’re giving you your wife back anyway”. So the Beggar changes the ending to “comply with the taste of the town”, reiterating the moral of the story, that is that the rich are as wicked as the poor, but only the poor are punished.
In the final scene, Macheath realises he must make a choice. He presents the ladies with partners for dance, and he chooses Polly for his dance partner – and as he tells her, also for life, because they were really married, but he tells her to keep it a secret. He sings a song about how he is like a Turk in his harem and has to choose one woman for his bed. Everybody sings the refrain “the wretch of today may be happy tomorrow”. The end!