There’s a lot to think about in Abi Morgan’s new play, co-produced by the National Theatre of Scotland and the Royal Lyceum Theatre, Edinburgh. The reasons for the onset of Alzheimer’s; scientific ethics; dwindling faith in the modern world; failed marriages; business involvement in research funding; even convent cookery – all get their moment in the spotlight. At times it seems like there’s a bit of a confusion of themes.

Yet bound together by some mesmerising performances, supple direction from NTS artistic director Vicky Featherstone, and a monumental, neo-brutalist set by Merle Hensel, this is a thoughtful yet entirely involving production that matches its harsh depictions with some unexpected humour.

When an uneasy alliance of scientists from the US and Scotland arrive at a remote highland convent to ask the sisters (27 of them, hence the title) to participate in their research into Alzheimer’s Disease, they cannot know the impact they will have on the nuns – nor how much they themselves will be influenced by a life of piety. As the scientists grow ever more attached to the convent, the sisters question their motives and methods, and the slow decline of the aging mother superior comes to mirror the gradual collapse of faith and relationships within the group.

Maureen Beattie brings an impressive muscularity and physicality to the complex role of Sister Ursula, mother superior-in-waiting, with a disarming humour and a febrile energy, yet also a foreboding awareness that her family history makes her an all too fascinating subject for Alzheimer’s research. She’s matched by Nicholas Le Prevost in a touching portrayal of chief scientist Dr Richard Garfield, whose rigid professional integrity hides the failures of his personal life.

Colette O’Neil is spellbinding as Mother Superior Sister Miriam, and her grief-stricken scream as dementia claims her once peerless mind brings a genuine chill to the room.

Yes, it’s a sprawling play, and it doesn’t provide any easy answers (in fact, it hardly knows when to stop asking questions). It’s surprisingly fast-moving, and its themes seem to slip through your fingers as soon as you’ve encountered them. But finally, as Sister Ursula’s fragile hold of her faith mirrors Garfield’s ever-loosening grip on his scientific beliefs, it’s a deeply emotional, considered production that will stay with you long after you’ve left the theatre.

27, Royal Lyceum Theatre, Edinburgh, until 12 November