If you browse to a the person's journal profile page, you'll see a "Gift a Membership" option under their profile picture. Click that link, and you'll be taken to a payment page which is very similar to the page you ay have used to buy your own membership.
On this page, you can optionally add a message to the gift recipient, or alternatively you can choose to make the gift anonymously.
If you're entitled to a discount on the site because of a pledge made during the community takeover of the site, it will be automatically applied here. Fill in your payment details, and once the payment is complete a message will be sent to the gift recipient to let them know they have received a gift.
You can't purchase a gift for someone who isn't an active user, nor can you gift a membership to someone who has a protected journal which you don't follow.