It begins as a sort of cable-ready message movie about the dangers of modern drug-based medicine, but morphs into a clever thriller with so many twists that you’ll probably stop counting. That’s why Steven Soderbergh’s “Side Effects” is so hard to review but so easy to recommend.

After a brief shot of a scene of domestic disorder, Scott Z. Burns’s script flashes back to the release of Martin Taylor (Channing Tatum) from prison after serving a four-year term for insider-stock trading. He’s met by his mother (Ann Dowd) and wife Emily (Rooney Mara), both of whom greet him warmly. But of course his return to a normal life isn’t easy. Martin has trouble finding a position in his old financial stomping grounds, and to make matters worse, Emily suffers from bouts of depression, and during one episode she crashes her car into a parking-garage wall.

Enter Dr. Jonathan Banks (Jude Law), a sympathetic emergency-room physician, who suspects that she was trying to commit suicide and puts her on a series of antidepressants, including some that are part of a test program he’s getting paid to conduct on his patients. The side effects of the medication are considerable, however, and one of them takes a violent turn that even the most hardened viewer will find a visceral shock.

It wouldn’t be fair to spoil the picture by following the plot any further than this. Suffice it to say that what happens brings Banks under a cloud of suspicion of malpractice and leads him to track down Emily’s former therapist Victoria Siebert (Catherine Zeta-Jones), who like him is involved in drug-testing trials. It’s his investigation of Emily’s past that leads to a series of revelations that take the narrative into increasingly dark directions. Twist follows twist, right up to a satisfying one at the close.

Soderbergh and Burns—who previously teamed up on both “The Informant!” and “Contagion”—manage to juggle the many strands of the labyrinthine plot with a mastery that actually recalls Hitchcock. To be sure, there are elements that you might wonder about in retrospect—why did Emily act as she does at the pivotal moment, for example, given what we know about her state of mind at the time when the denouement rolls around? But thrillers of this sort are bound to have a loose end or two, and what’s important is that it works beautifully as you’re watching it. Just be happy to be hooked for the duration and leave the nitpicking for later.

That injunction is easy to follow because Soderbergh, as usual acting as his own cameraman under the pseudonym Peter Andrews, proves so sneakily effective at sly misdirection. Innumerable directors have tried to pull of this sort of thing and failed, making his success all the more impressive. Soderbergh’s been reported as saying this will be his last film—at least for a while—and if that unhappily turns out to be the case, at least he’s going out on a high note.

The director’s intention to take a break may also explain his decision to cast several actors he’s worked with before, but whether or not that’s the case, the choices work. Tatum brings the same agreeably studly heft that served him so well in “Magic Mike” to this film as well, while Law manages to walk a fine balance between coming off as officious and self-absorbed on the one hand and, potentially, a hapless victim on the other; and Zeta-Jones gives Siebert the perfect air of arrogant confidence. Mara, a newcomer to the Soderbergh ranks, matches them with a turn that reflects both Emily’s fragility and her intensity, while Dowd brings genuine emotional heft to the role of a grief-stricken mother. All the lesser roles are handled with similar care, the production design (by Howard Cummings) is unobtrusively on target, Mary Ann Bernard’s editing keeps matters moving crisply while allowing for ample atmosphere, and Thomas Newman’s score is quietly supportive.

There’s a crafty, machine-like structure to “Side Effects” that recalls a picture like Harold Becker’s underrated “Malice” (1993)—which also involved the medical establishment–but Soderbergh’s take is far less glossy and snarky. It’s both grim and enjoyable—two things that might not seem to go together but in this case absolutely do.