To date, my method for banishing the dreaded earworm is to sing a song I actually like in an attempt to "trump" whatever piece of pop fluff is driving me batty. Apparently scientists at Western Washington University, led by psychology professor Ira Hyman, have discovered a much better way.
The trick, it seems, is to solve puzzles -- sudoku, for example. But by far the most effective puzzle was five-letter anagrams.
The reason for this, the researchers say, is that puzzles engage the brain just enough. The abstract from the study "Going Gaga: Investigating, Creating and Manipulating the Song Stuck in My Head" states:
"The return of intrusive songs depended on cognitive resources: people reported that intrusive songs returned during low cognitive load activities, and we found that overloading the cognitive systems with challenging activities increased intrusive song frequency."
Read more of "Get that song out of your head the scientific way" at Crave Australia.