From the Science Magazine, Nature :
Auditory imagery occurs when one mentally rehearses telephone numbers or has a song 'on the brain' — it is the subjective experience of hearing in the absence of auditory stimulation, and is useful for investigating aspects of human cognition. Here we use functional magnetic resonance imaging to identify and characterize the neural substrates that support unprompted auditory imagery and find that auditory and visual imagery seem to obey similar basic neural principles.Or, in more simple terms, when you recall a piece of music, from a popular song to a madly annoying advertising jingle, you "replay" it. This is not just a subjective phenomenon, the latest data indicates that it's the same parts of the brain that were initially stimulated that at work during recall. You retrieve the data from memory, rather than your ears, and pass it ( computer scientists would say "pipe it" ) through your hearing centres.
There's more on this over at MSNBC's Cosmic Log.
Each listener tagged certain tunes as familiar, and others as unfamiliar. Then the tunes were played while the listener was lying in a magnetic resonance imaging scanner. At various points in the soundtrack, the music went silent for 3 to 5 seconds, and researchers watched how the brain responded.It continues :
During the gaps in the unfamiliar music, activity in the auditory cortex diminished. But when there was a gap in a familiar tune, the auditory cortex kept working away.
"It's like the brain is still hearing the music," one of the researchers, Dartmouth's David Kraemer, told me today. "It's still activating that part of the brain that's activated when you're hearing the music. ... And it's interesting to note that we didn't instruct them to imagine the silent part. It's something that they just did spontaneously."
"It happens to me all the time : 'Yellow Submarine' has to be one of the most recurrent themes," he said. "If you find any way to get it out of your head, I'd be very interested in hearing about it."That's easy. All you have to do is not think about the word "Elephants" for the next 10 seconds.