The best way to gift a membership is as you described...putting it in your name, initially. Then you can change the name in the account information after you have purchased it. To do this, just click on the user name at the top of the screen, then "Edit Profile." All of the information can be changed there to the person you're gifting the membership to.
It's too bad you can't buy a credit towards a membership that they can activate. I have wanted to do that before for other members who already had a membership but they would have to get a brand new one :(