Yiddish playwright S. Ansky’s The Dybbuk (1912–1919) centers around Khonnon and Leah, a young couple that has been promised for marriage to each other by their fathers before they were born. Before the wedding, Leah’s father breaks off the marriage with the penniless Khonnon who dies instantly of a broken heart. However, Khonnon has his revenge when he enters Leah’s body in the form of an evil spirit called a dybbuk, which makes her act as though she is possessed. After rabbinical intervention, the likes of which Ansky had seen in exorcism-like ceremonies among the Hasidim when traveling through present day Belarus, Leah is forced to decide whether to marry the richer man or enter an unworldly union with the ghost of Khonnon. She chooses the latter to great dramatic effect at the fall of the curtain.
In Dybbuk, Bernstein used a Kabbalistic tree to derive some of the melodic motives. By Kabbalistic tradition, each letter of the Hebrew alphabet has its own numerical value. The name of the female lead in Dybbuk, Leah, is equal to the numerical value of thirty-six. Bernstein focused his composition on the divisions of thirty-six and eighteen (the numerical value of the Hebrew word chai (חַי), meaning "life"), each multiples of the nine—the number of notes including the repetition of the top note in a symmetrical octatonic scale. The result lent itself well to dodecaphonic composition but baffled critics, causing Oliver Knussen to write in Tempo, "…it is surprising to encounter Bernstein making use of numerical formulas derived from the Kabbalah… and producing his most austerely contemporary-sounding score to date." Jack Gottlieb commented, "The Dybbuk ballet (1974), however, marks a kind of departure for the composer since its concern with numerology results in far more hard-edged dissonant music (sometimes 12-tone) than in any of his other works."