When you hear a great song, you can think of where you were when you first heard it, the sounds, the smells. It takes the emotions of a moment and holds it for years to come. It transcends time. A great song has all the key elements — melody; emotion; a strong statement that becomes part of the lexicon; and great production. Think of “Bohemian Rhapsody,” by Queen. That song had everything — different melodies, opera, R&B, rock — and it explored all of those different genres in an authentic way, where it felt natural.

When I’m writing a song that I know is going to work, it’s a feeling of euphoria. It’s how a basketball player must feel when he starts hitting every shot, when you’re in that zone. As soon as you start, you get that magic feeling, an extra feeling. Songs like that come out in five minutes; if I work on them more than, say, 20 minutes, they’re probably not going to work.

Smokey Robinson and the Miracles, ‘Shop Around’

Robinson thought Barrett Strong should record "Shop Around," but Gordy persuaded Smokey that he was the right man for the song. After it came out, Gordy heard it on the radio and found it way too slow. He woke Robinson at 3 a.m. and called him back to the studio to re-cut it — faster and with Robinson's vocal more prominent. That one worked.

Weezer, ‘Buddy Holly’

In the early 1990s, Cuomo had an awkward girlfriend who was routinely picked on. His efforts to stick up for her inspired Weezer's breakthrough, a track whose bubble-grunge hooks and lines such as "I look just like Buddy Holly/And you're Mary Tyler Moore" helped the band reach a nation of pop-minded suburban punks. It also earned Weezer autographed photos from the real Mary Tyler Moore.

The Rolling Stones, ‘Miss You’

The Stones were in Toronto, rehearsing for their classic gigs at the El Mocambo Club, when Jagger, jamming with R&B legend Billy Preston, came up with "Miss You." With a disco groove and a touch of the blues via a harmonica player they found in a Paris subway, it became the band's first Number One hit in five years. "It's not really about a girl," Jagger said. "The feeling of longing is what the song is."

Bruce Springsteen, ‘The Rising’

Springsteen wrote the track about 9/11, taking the viewpoint of a firefighter entering one of the Twin Towers ("Can't see nothin' in front of me …") before unleashing the gospel-tinged chorus. It was the title track from an album intended to help his fans cope with the tragedy. "The fundamental thing I hear from fans is, 'Man, you got me through' — whatever it is," he told Rolling Stone in 2002.

Jackson Browne, ‘Running on Empty’

The Running on Empty album was Browne's grand experiment: a set of all-new songs recorded onstage, in hotel rooms and on the tour bus. The title track was actually written while Browne was driving to the studio each day to make The Pretender. "I was always driving around with no gas in the car," he said. "I just never bothered to fill up the tank because — how far was it anyway? Just a few blocks."

The Rolling Stones, ‘Brown Sugar’

The Stones take on slavery, sadomasochism, interracial sex — and make it catchy as hell. At Muscle Shoals studios, Jagger scrawled three verses on a pad, and Richards supplied an impossibly raunchy riff. Add some exultant punctuations and you have a Stones concert staple.

R. Kelly, ‘Ignition (Remix)’

R. Kelly's automotive metaphors for booty-knockin' in "Ignition" are subtler than they might've been; the lyrics were toned down at the request of a Chicago radio station. On Chocolate Factory, the original version of the song segued immediately into the hit remix.

MGMT, ‘Time to Pretend’

The rhythm was inspired by the wriggling of a praying mantis that VanWyngarden and Goldwasser kept in college. VanWyngarden wrote about rock-star fantasies ("I'll move to Paris, shoot some heroin"), though it's unclear how facetious the words are. "Some think we're druggies. Others see the tongue-in-cheek element," he said. "That's what I hope for as a lyricist: confusion!"

Gloria Gaynor, ‘I Will Survive’

In 1979, Gaynor's career was falling apart. Donna Summer had replaced her as the leading disco diva, and the 32-year-old Gaynor had recently suffered the death of her mother and had undergone spinal surgery. So when she belted out "I Will Survive," she brought extra attitude. The track was originally a B side, but after enterprising DJs started to play it at discos, it turned into a smash.

Joan Jett and the Blackhearts, ‘I Love Rock ‘N Roll’

Attempting to jump-start a solo career after her stint in the Runaways, Jett had her demo tape to "I Love Rock 'N Roll" rejected by 23 record labels. Tiny Boardwalk Records finally bit, but the label sold her the radio rights to the track for $2,500. Today, the song is worth nearly $20 million.

Coldplay, ‘Clocks’

Coldplay were scrambling to finish their second album and wanted to save "Clocks," with a churning piano riff inspired by the band Muse, for a later album. Luckily, a friend intervened. "He said, 'You're going on [in the lyrics] about urgency, and you're talking about keeping this song back,' " said Chris Martin. " 'That doesn't make sense.' "

The Drifters, ‘Under the Boardwalk’

A staple of beach-town jukeboxes every summer since its release, "Under the Boardwalk" evokes the carefree sounds of the shore. But its recording was no day at the beach. Johnny Moore was drafted to sing lead because the track's original singer, Rudy Lewis, died of a heroin overdose in his hotel room the night before the session.

The Cure, ‘Just Like Heaven’

"I've never been a big fan of irony," Smith said, which might be why this reverie of love, cut at a vineyard in the South of France, is his favorite Cure song. The band's girlfriends influenced the music. "The girls would sit on the sofa in the back of the control room and give the songs marks out of 10," he said. "So there was a really big female input."

Alice Cooper, ‘I’m Eighteen’

Before "I'm Eighteen," Cooper was just another hairy rock oddball. But this proto-punk smash defined the age when, in Cooper's words, you're "old enough to be drafted but not old enough to vote." A few years later, Johnny Rotten sang this at his audition for the Sex Pistols; by then, Cooper was a guest on The Muppet Show.

David Bowie, ‘Young Americans’

In 1975, Bowie traded his glammed-out Ziggy Stardust persona for an exploration of what he called "plastic soul." Yet this R&B homage is one of his warmest, wildest tales, recorded in Philadelphia with a then-unknown Luther Vandross on backing vocals and David Sanborn wailing on sax. "It's about a newlywed couple who don't know if they really like each other," Bowie said.

LaBelle, ‘Lady Marmalade’

This hit about a Big Easy streetwalker remains in rotation 35 years after it hit Number One. The group was from Philadelphia, but the nasty groove was classic New Orleans, with producer Toussaint and his house band, legendary R&B stalwarts the Meters, funking up the beat. Thanks to the ladies of LaBelle, every disco fan now knows at least one line of French: "Voulez-vous coucher avec moi?"

Justin Timberlake, ‘Cry Me a River’

This breakup aria marked the formation of the Timberlake–Timbaland team, a match made in pop heaven. The stunning video — in which Justin stalks an actress dressed to look like his ex Britney Spears — made clear the inspiration for "River." "It's a good-ass video," Timberlake told Rolling Stone. "I didn't want anyone to come off smelling like roses."

Jefferson Airplane, ‘White Rabbit’

"White Rabbit" was a trippy rock & roll bolero written by Airplane vocalist Slick. "Our parents read us stories like Peter Pan, Alice in Wonderland and The Wizard of Oz," Slick said. "They all have a place where children get drugs, and are able to fly or see an Emerald City or experience extraordinary animals and people… And our parents are suddenly saying, 'Why are you taking drugs?' Well, hello!"

Kelly Clarkson, ‘Since U Been Gone’

Pop gurus Max Martin and Lukasz "Dr. Luke" Gottwald wrote this indignant track with Pink in mind, but Clarkson's A&R rep snatched it up for the first-ever American Idol. The result was a career-making hit that gave teen pop a feisty new template. "I went to see Foo Fighters when I was off in Texas," Clarkson said, "and the first thing Dave Grohl said to me was, 'I love that song!' "

Rick James, ‘Super Freak’

James wasn't exactly modest about his ambitions. As he declared in 1981, "I wanna make Paul McCartney white-boy money!" He got it with the self-described "punk funk" of "Super Freak," from his breakthrough album, Street Songs. James enlisted the Temptations for background vocals. The song got a second life when MC Hammer jacked it for the 1990 megasmash "U Can't Touch This."

Beastie Boys, ‘Sabotage’

Adam "MCA" Yauch came up with the killer fuzz-bass riff at Manhattan's Tin Pan Alley studio, but it wasn't until a year later that the song was finished in L.A. With two weeks to go before Ill Communication was completed, Adam "Ad-Rock" Horovitz got all hot and bothered about paparazzi on the mike and came out of the song's breakdown with a scream for the ages.

Foreigner, ‘I Want to Know What Love Is’

This gospel-rock hymn featured Dreamgirls star Jennifer Holliday, one of the Thompson Twins and, most notably, the New Jersey Mass Choir. Said Jones, "I'll always remember them getting in a circle before we did it and everyone saying the Lord's Prayer." That probably didn't happen for "Hot Blooded" — but this soaring ballad became Foreigner's biggest hit.

The Strokes, ‘Last Nite’

Youthful angst on the Lower East Side: Lou Reed vocals and cool confusion, driven by the surging, garage-band sound that would go on to define early-2000s rock. The Strokes supposedly nicked the opening riff from Tom Petty's "American Girl." "I saw an interview with them where they admitted it," Petty told Rolling Stone. "I was like, 'OK, good for you.' It doesn't bother me."

The Smiths, ‘How Soon Is Now?’

Morrissey cribbed lyrics from George Eliot, but guitarist Marr cited another reference: Derek and the Dominos. "I wanted an intro that was almost as potent as 'Layla,'" he said. "When [it] plays in a club or a pub, everyone knows what it is."

Aretha Franklin, ‘Do Right Woman — Do Right Man’

Franklin disappeared after a 1967 session in Muscle Shoals, Alabama, leaving this simmering ballad unfinished. A few weeks later, she resurfaced in New York. The resulting vocal, said producer Wexler, was "perfection."

The Supremes, ‘Where Did Our Love Go’

After eight flop singles, the trio were known as the "No-Hit Supremes." The Marvelettes — Motown's top girl group at that point — passed on this song, and the Supremes didn't like their own recording. Until it hit Number One, that is. That foot-stomping beat is actually two boards banged together.

Van Morrison, ‘Into the Mystic’

"Into the Mystic" is one of Morrison's warmest ballads, an Otis Redding-style reverie with acoustic guitar and horns. The lyrics are truly mysterious: "People say, 'What does this mean?' " said Morrison. "A lot of times I have no idea what I mean. That's what I like about rock & roll — the concept. Like Little Richard — what does he mean? You can't take him apart; that's rock & roll to me."