Looking back 40 years, it’s clear now that Steven Spielberg’s 1977 science-fiction thriller “Close Encounters of the Third Kind” — hitting theaters this week in a remastered edition — is the Rosetta Stone for understanding everything Spielberg did after.

Remarkably, the movie holds up exceedingly well, even better than its box-office rival in 1977, George Lucas’ “Star Wars.” While the two movies are evenly matched in terms of special-effects wizardry, “Close Encounters” holds a slight edge in the wonder department because it deposits its visual marvels not in some galaxy far, far away but in the American heartland.

It’s in middle America — Muncie, Ind., to be specific — where we meet two ordinary people. Roy Neary (Richard Dreyfuss) is a utility company lineman, investigating a wild power outage, when he sees bright lights flying over the highway, flashing a light so bright it sunburns half his face. Single mom Jillian Guiler (Melinda Dillon) sees the same light and struggles against an unseen force that spirits away her 3-year-old son, Barry (Cary Guffey).

Roy becomes obsessed with UFO lore and with the image of a solitary rock formation. His erratic behavior troubles his wife, Ronnie (Teri Garr, so good in a thankless role), and their three kids.

Meanwhile, a parallel story plays out in Spielberg’s script. (This and “A.I. Artificial Intelligence” are the only movies he directed where he also is credited for writing the screenplay.) A group of scientists hops the globe, finding World War II aircraft in pristine condition in Mexico, or hearing a mysterious five-tone musical sequence from a guru’s disciples in India.

The lead scientist, Lacombe (played by the French director François Truffaut), aided by a translator (Bob Balaban), oversees a massive effort to get ready for whatever is coming, in the shadow of Devil’s Tower in Wyoming. When Roy, Jillian and other people try to get there, too, Lacombe senses the connection. He tells the military brass trying to contain the situation: “They were invited. They belong here more than we.”

( | Columbia Pictures) Scientists see alien ships landing in Wyoming, in a scene from Steven Spielberg's 1977 science-fiction classic "Close Encounters of the Third Kind," being released in theaters for its 40th anniversary.

Spielberg assembled one of his best teams ever for “Close Encounters.” Cinematographer Vilmos Zsigmond, who won the movie’s only Oscar, captured the mundane in Indiana and the spectacular at Devil’s Tower with equal weight. Editor Michael Kahn set the rhythms in motion and went on to be Spielberg’s editor to this day. (He’s working on “Ready Player One” for next spring.) Special-effects wizards Douglas Trumbull, Matthew Yuricich and Richard Yuricich created luminous spaceships, while monster maker Carlo Rambaldi’s work presaged his creation in “E.T.”

Then there’s John Williams, whose score didn’t just boost the action but — thanks to that five-tone sequence — became an integral part of the story. The capper is the breathtaking exchange of music-as-language between the humans and the alien mothership, one of Williams’ most sublime works. The score was nominated for an Oscar, but lost to Williams’ other score that year: “Star Wars.”

It was in “Close Encounters” that Spielberg first employed his technique of silhouetting figures in the foreground against bright beams of light to indicate something important or magical — a trick he used in “E.T. the Extra-Terrestrial,” “Jurassic Park” and the Indiana Jones movies. His deployment of lens flare spawned many imitators, particularly J.J. Abrams.

The other thing that makes “Close Encounters of the Third Kind” so stunning is that it’s self-contained. Aside from a “special edition” in 1980, with added footage inside the mothership (which Spielberg removed for the 1998 “collector’s edition” video release), there have been no sequels, no spinoffs, no reboots, no expansions of the “universe.” Spielberg’s wondrous movie has remained its own thing, which is something of a miracle.

* * * *

’Close Encounters of the Third Kind’

Steven Spielberg’s 1977 tale of humans encountering aliens returns for a 40th-anniversary release that’s worth seeing in theaters.

Where • Theaters everywhere.

When • Opens Friday, Sept. 1.

Rating • PG for action violence and a child in peril.

Running time • 137 minutes.