A new production of James Joyce's only play shines a spotlight on the morality of sexual freedom in marriage.

It isn't very well known, but Irish novelist James Joyce also composed a play. Not given a major outing in London since the acclaimed 1970 production by Harold Pinter (whose subsequent plays it arguably influenced), Exiles was written in 1914-15, around the time Joyce was writing Ulysses. It received its belated premiere in Munich in 1919, after having been turned down by Dublin's Abbey Theatre and the Stage Society in London.

Now, James Macdonald, director at the Cottesloe Theatre in London, attributes the rejection to the fact that Exiles was "wildly ahead of its time in its treatment of sexual freedom within marriage".

"Joyce admired...obsession with pursuing the truth", says Macdonald, "and a personal truth - at all costs, and the struggle of his characters to escape dead moral conventions. That's the idea he picks up and runs with in Exiles."

The play focuses on the semi-autobiographical figure of Richard Rowan, a writer who has returned to Dublin with his less educated wife, Bertha, and their eight-year-old son, after nine years' exile in Rome. In Dublin, Richard re-encounters Beatrice, a woman who has corresponded with him and acted as his muse while he was abroad, and Robert Hand, his best friend from boyhood who is now a prominent journalist.

Robert is keen to help Richard secure the post of professor of romance languages at Dublin university. He is also keen on seducing Bertha. She accepts his advances passively but then, in a scene of creepy theatrical surprise, she is makes detailed reports on the adulterous advances to her husband.

The play turns, startlingly, on Richard's refusal to guide, defend or bind his wife in her handling of this predicament. He neither encourages her nor dissuades her from going to meet Robert, and it is left studiedly ambiguous as to whether Bertha and Robert's relationship ever becomes sexual. Not for nothing did Joyce describe the play as "three cat-and-mouse acts".

Exiles has an autobiographical starting point in Joyce's relationship with Nora Barnacle, his untutored lover, partner and, after many years, wife. "It is not in the darkness of belief that I desire you," Richard Rowan, Joyce's self-projection, tells Bertha in the final moments of the play, "but in restless, living, wounding doubt. To hold you by no bonds, even of love, to be united with you in body and soul in utter nakedness - for this I longed."

Part of the fascination of the play is the elusiveness of Richard's real motives. Bertha suspects that she is being granted her freedom so as to clear the way for his assault on Beatrice. There are heavy suggestions that Bertha is the surrogate through which the two men express their own mutual attraction. "You are so strong that you attract me through her," says Robert, who feels that he has been betrayed by the collusion between husband and wife.

As well as prefiguring the latent homosexuality that features in a great deal of modern drama, Macdonald argues that Joyce pioneered "the idea of two characters who are both opposing halves of the writer's own psyche."

Macdonald says: "I think the audience will have to buy into Richard, otherwise the play is unbearable: three people being tortured by this impossible man. What you have to admire in him is how much he's prepared to risk for his own notion of idealism and how much he's prepared to torture himself."

"Why the title Exiles?" Joyce writes in the notes: "A nation exacts a penance from those who dared to leave her - payable on their return." But the deeper meaning is that we are all unbridgeably exiled from one another.

National Theatre Cottesloe, South Bank Centre, London SE1 (020-7452 3000, www.nationaltheatre.org.uk) to 26 October

Which Course magazine is now available online at whichcourse.epagesmarketing.com. Contact Joshua Gilbert - tel: 020 7005 2283; fax: 020 7005 2292.