Hmm, they both have their pluses. If you don't have friends, Rock band is LAME. The guitar parts in Rock Band are a little on the easy side if you ask me, but that might just be me. The drums are a blast, and if you're into karoke, the singing can be pretty enjoyable. Guitar Hero is fun no matter how many people are playing, plus you can battle anyone online you want in GHIII.
The other factor is simply what songs each one has. Are you going for quanity or which one has more of the songs you want to listen/play? Now I haven't played a ton of Rock Band, but I must say I like the song selections in Guitar Hero a little better. On the flip side, Rock band has alot more songs, plus you can download a ton more.
The other thing I like about RB is that you can make your own rocker, that's the only thing that really dissappoints me about GH. I guess in the end it's all personal perference. RB is basically GH taking a couple steps further, though I don't think you could have RB without GH. I personally love both, and would choose either one any time. Why pic one if you can have both, you know what I mean?