This is a great thread and one that - like the OP's friend - I recently dealt with, myself. Obviously, every situation is different, as is how you deal with it in order to find a resolution that you're happy about.
In my case, just like someone else noted above, I was asked for a salary range before I even interviewed. But, lucky for me, my prospective employer posted a range for the position I was going to interview for. So, I chose a (narrow) range that was about 60% or so (i.e. better than the halfway point) of the range. The low end of that range is still more than what I was previously making. However, I was imagining that - if they offered me the job - it would be somewhere in the middle of the range I'd given. When they did offer me the job, they offered me the bottom of the range (just like someone else here mentioned happened to them) PLUS a signing bonus. I'm pretty sure that they immediately offered the bonus in order to snuff out any chance for a negotiation on my part. In retrospect, I thought, "How about you just up the salary by $X and you can keep the singing bonus". But, of course, hindsight is always 20/20.
My case - like everyone's - is different. It wound up that they offered me a position that WASN'T the one I applied for and the the salary range I'd given was likely more than what they'd ordinarily pay for this position. Thus, what they did offer -- even though it was the bottom my range -- was likely the mid or upper-end of what they would pay. Also, due to some administrative snafu on their part, I have to wait an additional few weeks before I can start. They called a few days ago to apologize and offer me an ADDITION to my signing bonus for my troubles. So, that was a nice.
In the end, I can live on the salary I'll be making and I'm satisfied with how this turned out. Happy? Maybe not. But, satisfied? Yes.