Sam Raimi’s grand and magical new picture recalls the sense of wonder that movies could once awaken in us. Unlike such recent 3D fantasy riffs as Hansel & Gretel: Witch Hunters and Jack the Giant Slayer (which tanked last weekend), Raimi’s Oz the Great and Powerful is untainted by modernist irony -- it carries us back to the clear-cut emotions and moral outlooks of traditional fairy tales and asks us to take them straight. And while the digital marvels with which these sorts of movies now swarm have come to seem rote, this film deploys them with fresh glee.

The 3D, for example. If we must have 3D, let’s really have it. Not just for tastefully subtle depth effects; let’s have gold coins, gouts of water, and heavily fanged flying baboons sailing off the screen and right into our faces. And a big serious score -- put in that call to Danny Elfman. Raimi, who knows cheap thrills from his Evil Dead days, and bottomless budgets from his Spider-Man tenure, is just the man for this job.

The story is a prequel to the 1939 Wizard of Oz, filling in the background of the famous wizard and relating how he came to be in that land of witches and winkies and scampering munchkins. Like the earlier film, this one’s opening passages have been shot in black-and-white, and they’re framed in a boxy, old-fashioned aspect ratio that gives them an appropriately antique feel. (The story is set in an unspecified period that seems plainly Victorian.)

James Franco is Oscar Diggs (nickname Oz), a smalltime magician with a traveling circus that’s currently encamped outside a Kansas prairie town. Inside his rube-packed midway tent, we see that Oscar is pretty good with the levitations and prestidigitations of his craft. But he’s a dodgy character, an itinerant heartbreaker with a girl in every town along the carnival circuit (here it’s a sweet blonde named Annie, played by Michelle Williams). When his amorous activities ignite the ire of a jealous circus strongman, Oscar is compelled to flee in a hot-air balloon. His relief at escaping is short-lived, though -- the towering funnel of a tornado is headed straight at him, and it sucks him down into its furious vortex.

The movie shifts to glorious color as Oscar’s battered craft falls to earth in the Land of Oz. Here Raimi and his battalion of VFX artists vividly simulate the saturated three-strip Technicolor environments of the 1939 Oz -- the grasses and foliage and big, impossible flowers radiate a jewel-like beauty. (Some care had to be taken over hewing too close to the earlier film. Although the L. Frank Baum novels from which both movies derive are in the public domain, The Wizard of Oz itself isn’t. Thus, among other things, no ruby slippers, which were a non-Baum addition to that film.)

Oscar soon encounters a young woman named Theodora (Mila Kunis), who tells him that she is a witch -- a good witch -- and that she believes him to be the wizard prophesied by the late king: a savior who’ll protect the people of Oz from the cruel depredations of an evil witch named Glinda. Theodora takes Oscar to the resplendent Emerald City to meet her sister, the icy Evanora (Rachel Weisz), who is now the kingdom’s regent. Evanora shows Oscar around the castle -- lingering in a vast room piled with gold -- and tells him that he can be king, if he wants, but with one requirement: he must travel to the dreadful Dark Forest and destroy the magic wand of the hated Glinda (and presumably Glinda herself).

Of course Glinda (Michelle Williams again) turns out not to be evil at all (let’s say someone else is). She’s a paragon of unblemished goodness, and when Oscar admits to her that he’s not really a wizard, she tells him that doesn’t matter -- he has only to make the people of this downtrodden land believe he is…and maybe convince himself, too.

Like Judy Garland’s Dorothy on the road to Oz in 1939, Oscar accumulates lovable sidekicks on his way to the Dark Forest. First there’s a winged monkey named Finley (voiced by Zach Braff), then a knee-high ceramic sweetie called China Girl (Joey King), whose cracked porcelain legs Oscar repairs with glue. (“Magic in a bottle!” he says.) Please be forewarned that both of these characters are exceedingly cute.

After a series of lively 3D adventures, Oscar and his diminutive companions finally hook up with Glinda, and at her stately white castle Oscar agrees to help launch an assault on the true Wicked Witch that will drive her from the kingdom. Oscar may not be a real wizard, but he knows some tricks.

The role of Oscar almost went to Robert Downey Jr., which I think would have been all wrong. Downey is a treat to watch in just about any movie, but he gives off a cocky contemporary vibe. For a stylized quasi-period tale such as this, Franco, with his warm smile and easy diffident humor, is just right. And not only does he have chemistry with the glowing Michelle Williams, he has chemistry with the monkey and the china doll, too. Talk about range.