While traveling through the Omega Sagitta system, the U.S.S. Enterprise aids a disabled cargo ship and plays host to its sole occupant, Captain Okona.

Once on board the Enterprise, the handsome, roguish Okona charms the crew — particularly the women — with his quick wit and mischievous manner. Data, however, is unable to understand Okona's jokes and looks to Guinan and the holodeck for lessons in human humor.

Meanwhile, two small interplanetary vessels lock their lasers on the U.S.S. Enterprise, demanding Okona's surrender. First, Debin accuses Okona of getting his daughter, Yanar, pregnant; then Kushell, with his son Benzan at his side, charges the dashing Captain with stealing his nation's prized Jewel of Thesia.

Knowing that releasing Okona to either Debin or Kushell would cause a war between their respective homelands, Picard agrees to help Okona make a fast getaway. However, a discussion with Wesley Crusher convinces Okona to change his mind and turn himself in.

When all of the parties are beamed aboard the U.S.S. Enterprise to discuss the matter, Okona proposes to Yanar, which prompts an outburst from Benzan, who confesses that he fathered Yanar's child and took the jewel to present to the girl as his pledge of marriage. Okona also admits that he's been acting as a go-between for the couple, whose families have been feuding for years. Once everything is out in the open, Yanar agrees to marry her beloved Benzan.

The ordeal resolved, Data returns to the Holodeck to try out some jokes he's learned in front of an audience. After a disappointing attempt, Data reaches the sad conclusion that he is incapable of being funny. But as the crew bids good-bye to Okona, Data is caught off guard by a question from Okona and delivers a response that leaves everyone on the bridge laughing.