Seriously, I would be pissed if my "friend" was using my account to get their music; its not like the songs are free and personally, if someone can afford to spend $600/400 on an iPhone or Touch, then they need to be able to pay for their own songs.
I think, but not 100% sure, that it uses the Apple iTunes account that the iPhone was synced to. I had some credit from my $100 rebate that I bought iTunes gift cards. When I was in a nother city at my brothers I hooked into his WiFi and downloaded songs. It used my iTunes account and even knew that I had credit that it applies my purchases to.