Since virtually everything Stephen King has ever written is destined to be adapted to film or television one way or another, it was only a matter of time before someone decided to take on Gerald's Game, his 1992 novel that is set almost entirely inside the mind of a woman who is handcuffed to a bed in a remote cabin. The story's singular location, its intent focus on psychological interiority manifested by "voices" representing different aspects of the protagonist's personality, and her inability to, well, move, would seem to make Gerald's Game a, if not unfilmable book, one that at the very least poses a number of distinct challenges.

As it turns out, director Mike Flanagan (Hush), who also co-wrote the screenplay with his regular collaborator Jeff Howard, is largely up to the task. His Netflix-produced adaptation of Gerald's Game is better than you might expect it might be, although he never quite manages to completely solve the tricky balancing act between maintaining the suspense and tension inherent in the protagonist's life-or-death dilemma and the drama of her reeling mind, which begins to fracture from the stress of her ordeal, creating psychological fissures through which long repressed memories involving her sexually abusive father begin to emerge. These two elements of the story are inextricably interwoven and play into the film's core theme of how awful men can be (King's book begins with an epigraph from W. Somserset Maugham's short story "Rain" in which a character screams, "You men! You filthy dirty pigs! You're all the same, all of you. Pigs! Pigs!"). Gerald's Game is ultimately a story of empowerment, but the road to that empowerment is a somewhat uneven one.

The aforementioned protagonist is Jessie Burlingame (Carla Gugino), who we first meet as she and her husband Gerald (Bruce Greenwood) are packing for a weekend getaway to their vacation cabin, where they hope to rekindle their dying marriage. Gerald's idea of fanning the flames involves handcuffs, Viagra, and rape fantasies, which Jessie is initially willing to entertain, but quickly sours on. The cracks in their relationship open into gaping maws as they argue, providing initial insight into their jagged power dynamics. And then Gerald has a heart attack and collapses on top of her. She pushes him off, he lands with a dull thud on the floor, and what started as a kinky sex game suddenly turns into a real-life game of survival for Jessie-physically and psychologically. Her cell phone is just out of reach on the bedside table, the keys to the cuffs are on the bathroom counter, and the stray dog they saw near the cabin scavenging roadkill makes a not unexpected appearance when he smells fresh meat on the floor.

The rest of the film alternates between Jessie's fight for survival (who would have thought that getting a glass of water off a shelf could be so suspenseful?) while cuffed to the bed, her internal psychological struggle that is manifested in versions of both herself and Gerald with whom she interacts, and memories of her experiences as a 12-year-old (Chiara Aurelia) being sexually abused by her father (Henry Thomas) during a total eclipse of the sun. The film's survivalist elements are its best, as Flanagan stages the details of her excruciating physical ordeal for maximum impact. The dialogue-heavy sequences between Jessie and her internal projections are less effective, if only because they often function with such blunt obviousness to articulate her own struggles with emotional repression and the effect that has on her relationships with the less-than-ideal men in her life. Her survival requires not just escaping those handcuffs, but escaping the men that manipulate her to their own ends. This toxic masculinity takes its most nightmarish shape in frightening figure that Jessie sees standing in the corner of the bedroom that night-a deformed, lurid hulk of a man that might be a figment of her imagination, might be some kind of intruder, or might be Death itself.

When Gerald's Game works-which it mostly does-much of its success can be attributed to the intense, engaging performance by Carla Gugino, who conveys a complex woman who has spent most of her life acquiescing to the men around her and, via her ordeal on the bed, emerges as a woman with her own voice. The physicality of her performance is raw, and she makes us feel her character's panic, discomfort, anger, and fear. Greenwood has a more prosaic role, and he plays it accordingly; his Gerald is a garden-variety chauvinist whose darker impulses come to light just before his are snuffed out by an untimely heart attack. He does get to play a few interesting notes as Jessie's projection of Gerald, suggesting shades of empathy that his real-life counterpart seemed to lack.

Flanagan, who directed three generally well-received horror films last year-Hush, Before I Wake, and Ouija: Origin of Evil-keeps things simple and direct. He and cinematographer Michael Fimognari, with whom he has worked on his past four films starting with Oculus (2013), allow for some expressionist visual elaboration in the eclipse flashback sequences, which are bathed in a turbulent blood red. He gives in to the temptation of throwing in a few jump scares, as well, even though the material doesn't really call for them. He also delivers what is without doubt one of the grisliest, most difficult-to-watch escape sequences imaginable that becomes like a bloody, physical embodiment of Jessie tearing free of her past shackles and emerging into a bright new world.