Is there a way to purchase an app from the Mac App Store as a gift?
No, Apple didn't implement the gift feature in the Mac App Store. I imagine it will happen eventually, but it isn't there right now.

Your only option would be to buy your friend an iTunes gift card, which can be used to buy apps.

Here's my source