I used to write with headphones on and loud music playing. That was in my youth (what seems like a very long time ago) and was in part due to my living circumstances. I grew up in a happy, busy household and it was a necessary thing to cut off the hustle and fuss around me in order to find that special focus. Now, though, things are very different. The most productive writing sessions I have these days are just me in a quiet room (thankfully I have a place at a friend's house to go to sometimes) with no music or any other distractions. This is especially helpful during editing when acute concentration is required. During composition, however, I do still like to have some kind of background music. The best music is unobtrusive and, at best, inspirational in a filmic sense. I like to have a movie soundtrack playing - some of favourites are the soundtracks to movies like Batman Begins, Rocketeer, or Star Trek 2 or 3 (yes, there's a James Horner theme going on here). As J.K. Rowling said in Harry Potter and the Philosopher's Stone, "Ah music. A magic beyond all we do here."
What music do you listen to?