At the Birdcage, Lily is performing a number for the audience and notices a man in a white suit. He merely sits at his table, watching and smiling while twirling three walnut half-shells on the table before him. After her set, Lily comes over and asks the man what he's doing there. He introduces himself as a thimblerigger, running the classic shell-and-pea game. However, the Thimblerigger assures Lily that he's not there to gamble with anyone. He talks about how he merely pursues his vocation as a hobby, but informs her that he's there to destroy a man.
The next day at the marshal's office, Johnny is talking to Dan about the Laramie Glee Club, where the bachelors gather to play poker. As he spots Lily coming up, Johnny jokingly tells Dan that he couldn't join. Lily hears him talking and comes in, and Johnny makes a hasty exit. After teasing Dan about the prospect of marriage, Lily tells the marshal about the Thimblerigger and his claim that he's going to destroy a man.
Dan goes to the Birdcage and talks to the Thimblerigger, who is still sitting, smiling, and twirling his shells. He asks how the Thimblerigger plans to kill a man but the Thimblerigger corrects him, saying that he's there to destroy a man not kill him. The customers listen as the Thimblerigger talks about how in Louisiana, a man and his young newlywed bride were riding home when three bandits pulled them over. The groom begged for his life, offering them everything he had if they spared his life. He offered them his wife and, disgusted, the head bandit told the groom to ride off. The wife disappeared, never to be seen again, and the husband initially told the townspeople that he fought the bandits but were overpowered. However, when one of the bandits was later arrested, he testified in court to what truly happened. The townspeople realized what the groom had done and he left town and changed his name.
The Thimblerigger informs Dan that the groom is in Laramie and that he's there to reveal him for who he really is. A local rancher, Ed Shafter, steps forward and insists that a man like that ought to be hung. When Dan asks who the husband is, the Thimblerigger says that he's not sure and that even if he was, there's no law against cowardice. What the husband fears is exposure, but he's just move on to another town if he were exposed. The Thimblerigger plans to play on the husband's guilt and suspicion, making him suffer like his bride suffered before she died. The man will come forward and play the shell-and-pea game, and he'll be the one that gets the pea. When he does, the Thimblerigger and everyone else will know him for what he really is.
Dan thinks the whole thing sounds strange. However, the Thimblerigger assures him that he's doing nothing against the law. Ed steps forward and offers to play the game, confident that he won't find the pea. As he sits down, Ed insists that he's no coward and that he would have died rather than give up his wife. As he prepares to pick a shell, Ed warns the Thimblerigger that if there's a pea under it, he'll kill him. However, the Thimblerigger simply smiles and says that he'll take his chance. There's no pea beneath the shell Ed picks and he offers a drink to every man in the Birdcage who plays the game. As a line forms up, Ed goes to the bar and notices his neighbor, Sam White, holding back. Ed invites him to join the line and get a free drink, but Sam says that he has business that can't wait and leaves.
Later, Dan visits the Birdcage and Lily explains that Ed is intimidating every man in town to play the game. Everyone is going along for fear of being branded a coward if they refuse. Dan admits that he can't do anything because the Thimblerigger's actions are perfectly legal, and that if he kicks him out of the Birdcage then he'll just go to another saloon. Lily asks Dan to find the man before things escalate and the marshal says that he'll do what he can. As he leaves through the saloon, Ed comes up to him and boasts that they have a group of regulators ready to kill the husband once he's revealed. Dan orders all of them to turn in their guns and leaves, but Ed simply says they weren't planning on shooting the coward and takes out a lynching rope.
That night, Dan and Johnny are in the office when they hear an argument in the street. Sam is arguing with some of the men from the Glee Club, who want Sam to join them for a drink at the Birdcage. Sam angrily refuses and Dan tells them to move on. He then takes Sam into the marshal's office and assures him that he'll protect Sam no matter what he's done. Sam isn't comforted and complains that Dan is making him seem guilty by only offering to protect him. Dan insists that it isn't so but a near-hysterical Sam accuses him of working with the Thimblerigger to frame him. The marshal tells Sam that he can go anytime he wants, but Sam takes it the wrong way and figures that Dan is telling him run. Realizing that Sam is too afraid to listen to reason, Dan tells the man to get some rest.
Later, Johnny is with the Glee Club and the other men when Sam comes in. He walks over to the Thimblerigger's table while Johnny goes to bring Dan to the saloon. Sam tells Dan to leave him alone, reminding him of his promise to protect him. Looking around, Sam figures that he has more of a chance with the Thimblerigger than he does with Ed and his lynch mob. Dan orders Ed to drop his noose while Sam reaches forward and chooses over a shell. Still smiling, the Thimblerigger flips it over and reveals the pea beneath.
Sam stares at the white-clad figure in shock and asks who he is. The Thimblerigger explains that he was the head bandit who took Sam's wife and sent the coward on his way. Sam, disgusted, says that he's a common thief and draws a gun. He guns down the Thimblerigger and Dan disarms him. As Johnny takes Sam to jail, Lily and Dan go the dying Thimblerigger. He explains that the wife stayed with him, but she never stopped loving Sam even though he was the coward who abandoned her. The Thimblerigger hated Sam for managing to hold onto her love even when he didn't deserve it. The night of the robbery, the Thimblerigger didn't get a good look at Sam's face. The only thing he saw was the look of fear in Sam's eyes, and he knew he could pick it out if he saw it again. In the six years since Sam fled, the Thimblerigger has sought that look in the face of every man who played the game, and Sam was the one he found.
As he dies, the Thimblerigger flips over the other two shells and a pea rolls out from each one. Dan wonders why Sam came to play the game and Lily figures that Sam wanted the chance to prove he was innocent, even though he knew he was guilty. The marshal says that Sam did have a chance... six years ago when he gave up his wife.