The marvelous Israeli film “Ushpizin” reminds us that there’s nothing rarer nor more precious than an enlightened comedy.

In lieu of the bathroom humor, cartoonish villains and strenuous slapstick that define modern jokefests, Gidi Dar’s movie brims with a uniquely Jewish wistfulness and generosity of spirit that can be traced to Sholem Aleichem and his forebears.

When a friend asks the main character how he is, he replies, “Terrible.” Then he adds, “Praised be His name.”

How Jewish is that? Well, a variation of that joke can be found on most every page of Leo Rosten’s “The Joys of Yiddish.”

“Ushpizin” is an unabashedly spiritual film, in part because it derives its humor from decent characters wrestling with the difficulty of doing the right thing.

The premise is as simple and straightforward as a vintage Neil Simon play. When a financially struggling Orthodox couple’s prayers are answered on Erev Sukkot, their troubles really begin.

Miraculously blessed with a discarded, first-rate sukkah and an envelope filled with cash to buy an etrog, lulav, food and wine, Moshe and Malli couldn’t be happier.

But a reprobate from Moshe’s past shows up, accompanied by a boorish pal, and a shadow is cast over the celebration. (Any resemblance to David Cronenberg’s “A History of Violence” is purely coincidental and infinitely more benign.) Although the couple embraces the commandment to welcome guests into the sukkah, Eliahu and Yossef would test anyone’s good will.

In reality, what’s being tested is Moshe and Malli’s five-year marriage. Although they love and respect each other, their inability to produce children is a source of tension.

“Ushpizin” (which translates approximately as “holy guests”) marks an unusual collaboration between secular filmmakers and a religious cast. The director acceded to a number of conditions, including not working on Shabbat. Dar even agreed that when the film opened in Israeli theaters, there would be no Shabbat shows. Needless to say, that proviso doesn’t apply to U.S. bookings.

Shuli Rand, who plays Moshe and wrote the screenplay, had performed in Dar’s earlier films before he became ultra-religious and gave up acting. Rand exudes charm and trustworthiness, and his comeback earned him last year’s Israeli Academy Award for Best Actor.

Before he decided to star in “Ushpizin,” however, Rand obtained a blessing from his rabbi. Further, he would not act with any woman other than his wife. For the record, the nonprofessional Michal Bat Sheva Rand conducts a fine performance.

Beyond its entertainment value, “Ushpizin” makes an enormous contribution by deflating stereotypes of the ultra-religious. The notion of the domineering husband and acquiescent wife is demolished, for this is a love story about two equal partners.

And although the power of prayer is acknowledged at every turn, and the will of God is paramount, the observant Jews aren’t portrayed as dogmatic automatons. It is still the individual’s choice whether or not to be kind and honest, and to rectify mistakes and seek forgiveness.

Indeed, “Ushpizin” slips in a dig at those who mask their indifference toward the less fortunate with rote advice to ask God for help. Being religious is not a justification for certain behavior, the film suggests, but an impetus to behave better.

But you certainly don’t have to be ultra-religious to enjoy “Ushpizin.” Like Eliahu and Yossef, secular moviegoers are likely to find this trip to Jerusalem not just pleasurable, but inspiring.

“Ushpizin” opens Wednesday, Nov. 23 in San Francisco.

J. covers our community better than any other source and provides news you can't find elsewhere. Support local Jewish journalism and give to J. today. Your donation will help J. survive and thrive!

Michael Fox is a longtime film journalist and critic, and a member of the San Francisco Bay Area Film Critics Circle. He teaches documentary classes at the Osher Lifelong Learning Institute programs at U.C. Berkeley and S.F. State. In 2015, the San Francisco Film Society added Fox to Essential SF, its ongoing compendium of the Bay Area film community's most vital figures and institutions.