The trick is in finding the right music. Something that stirs the creative mind, something which matches the mood of the work, and most importantly of all, something which isn't overly distracting.
For example, listening to Queen generally doesn't help. Instead of writing, I end up singing along. Power ballads are too powerful. They distract me from the writing process.
I don't have to avoid lyrics: there are many songs that work well with lyrics, so long as they don't overpower the music.
Lately, I've been really enjoying the latest Daft Punk album "Random Access Memories". I've been pleasantly surprised by this album. It's a big change since the days of Harder, Better, Faster, Stronger. They're still incredibly creative though. It's a fun album, and rather different from what I normally listen to. And as I'm writing science fiction, it seems somehow fitting that the music is performed by glittering robots.
Sometimes, when I'm looking for something a little more frenetic, I'll listen to some Nine Inch Nails. The 'Ghosts' album is mostly non-vocals, and rather atmospheric and haunting.
[soundcloud url="https://api.soundcloud.com/tracks/102164689" params="color=ff5500&auto_play=false&hide_related=true&show_artwork=true" width="100%" height="166" iframe="true" /]
Another really great soundtrack to listen to while writing is the soundtrack to Blade Runner, by Vangelis.
If I was writing a story in the Wild West, I would likely want to listen to something more evocative of westerns, possibly some older country music. If I was writing something a little more Enlightenment or Reformation period, I'd listen to something more classical. Futurism however, has the distinct advantage of catering to more eclectic tastes.