Quick: Think of the guitar riff that opens the Temptations hit "My Girl." Got it? Now, think: Who played it?

His name was Robert White and he was a member of the Funk Brothers, the legendary house band of Motown Records, which is given a long-deserved spotlight in "Standing in the Shadows of Motown." For decades, the dozen or so keyboardists, guitarists, bassists, drummers and percussionists who created Motown's signature sounds in a tiny basement studio have been living -- in a few cases, dying -- in obscurity. Documentary filmmaker Paul Justman, working with Allan Slutsky's 1989 book about the group, has rectified that historical slight with a soaring cinematic love letter to the prodigiously gifted session cats who, in Justman's words, were "the greatest hit machine in the history of pop music."

Using interviews with surviving members of the Funk Brothers, plus archival material, still photographs and reenactments, Justman tells the story of how, during the late 1950s and early 1960s, Motown founder Berry Gordy trolled the show bars and nightclubs of Detroit, looking for musicians to play behind such up-and-coming stars as Little Stevie Wonder, Martha Reeves and Diana Ross. The men he hired were from the world of jazz and blues -- Miles Davis and Muddy Waters were their idols, not Marvin Gaye. But when they crammed together in Gordy's Hitsville USA studio (which they dubbed the Snakepit), they infused the pop hits with soul, originality and the the propulsive beat of the factories that many of them had migrated north to work in. Comparing their fat, in-the-pocket groove to that of a big band, Detroit producer Don Was says simply, "They could swing like crazy."

"Standing in the Shadows of Motown" takes viewers from the early days, when pianist Joe Hunter, guitarist Eddie Willis, drummer Benny Benjamin and bass player James Jamerson first joined Gordy's operation, to 1972, when Motown suddenly left Detroit for Los Angeles. At their peak, the Funk Brothers had expanded to include three guitar players (Willis, White and Joe Messina), three keyboardists (Hunter, Earl "Big Funk" Van Dyke and Johnny Griffith, who died Sunday), three drummers (Benny Benjamin, who died in 1968, Richard "Pistol" Allen and Uriel Jones), two bassists (Jamerson and Bob Babbitt) and two percussionists (Jack Ashford and Eddie "Bongo" Brown).

Variously combined, they played on -- and defined the sound of -- some of the most influential music of the era, from "Heat Wave" to "What's Going On." Throughout most of that time, the distinctive Motown vibe was attributed to everything but the studio musicians -- the arrangers, producers, stars, even the wood that lined the Snakepit's walls. Some attributed the sound to Detroit soul food, "but try putting barbecued ribs in that room and counting out 1, 2, 3, 4," quips one of the Funks.

Between interviews with surviving Funk Brothers including Joe Hunter, Jack Ashford, Joe Messina and Bob Babbitt, Justman intersperses clips from a 2000 reunion of the band, during which the musicians backed up performances by contemporary artists singing Motown hits. It's during these passages, as well as some tepid reenactments of the musicians' anecdotes, that "Standing in the Shadows of Motown" is most uneven, as Justman's camera restlessly cuts away from the very musicians he wants to honor. After hearing the men talk about the techniques that resulted in their signature sounds, it would be nice to be able to concentrate on Babbitt's extraordinarily fluid playing on "What's Going On," for example, instead of watching Chaka Khan lifelessly deliver lyrics from an electronic prompter. (Ben Harper and Meshell Ndegeocello don't fare much better.) Still, there are a couple of memorable moments during these sequences: Joan Osborne tears up a soaring rendition of "What Becomes of the Broken Hearted," and Gerald Levert and guest horn player Tom Scott engage in a scorching duet on "Shotgun."

"Standing in the Shadows of Motown" pays due reverence to the Funk Brothers who didn't live long enough finally to enjoy their moment of recognition. But far from elegiac, the film is a testament to art, life and survival like the similar but superior "Buena Vista Social Club," Wim Wenders's 1999 chronicle of the reunion of a group of aging Cuban musicians. With luck, Justman will soon see fit to visit Muscle Shoals and Memphis -- home towns of two other legendary house bands -- to create what could be the definitive portrait of an audible but invisible chapter in American cultural history.

Standing in the Shadows of Motown (108 minutes, at the Cineplex Odeon Dupont Circle and Landmark Bethesda Row) is rated PG for language and thematic elements.

"Standing in the Shadows of Motown" reunites, from left, Joe Hunter, Eddie Willis and Joe Messina in the original "Snakepit" studio.Joan Osborne sits in with, from left, Jack Ashford, Pistol Allen, Joe Hunter and Eddie Willis.