Various music, like haggis, is an acquired taste. What some people love, others hate. While one person swears by Celine Dion, another will want Pantera. They will hate the other's music, and there will be no middle ground between them.
This in turn creates the problem of buying a musical gift for someone who you don't really know that well. If this the case, you should avoid buying a CD for them.
If you feel, for whatever reason, that you have to buy a CD for someone, then you have to be very careful that you get something they like. Otherwise, you may never have the chance to hear the music you so lovingly bought them, as it will sit in the packaging for all of eternity.
When buying a CD for someone, make sure you know their musical tastes. This is the most important point. Take a look at their current CD collection and make note of the types of music they have. If they have a lot of Classic Rock CDs, then cater towards that.
You can also talk to people who know them best about what kind of music they like. Of course, you have to be careful here. If their friends want to play a trick on the recipient, they may tell you he loves Garth Brooks, when in fact, he can't stand country music.
As usual, a gift certificate for a music store is an excellent way to go. Instead of taking the time to choose something for them, meanwhile risking to get them the wrong thing, just sit back and let them do their own shopping. Don't give them cash, though, because then they may not even use it on music at all. You do want to give them a musical present as their gift, right?
The last option is an easy one, but it gives away the surprise. You could simply ask them who their favorite band is and if they have the newest CD by them. If they say they do not, then go and buy that for them. The jig may be up but at least they get what they wanted.
Music taste changes all the time, and what someone liked one year, may not be true the next. Make sure you research what they like, talk to their friends and put some thought into the gift. If you get them a CD they like, it will be a lot more valuable in terms of the kindness of the gift, than in terms of the price you paid for it. They will thank you again and again for it.