Depends on the laws in your state. However, if your friend doesn't live in the same state you do, you need to ship it to a FFL, or federal firearms licensee in your friend's area.
Assuming you're doing this face to face, again, depending on your state's laws, it might just be a quick, simple thing. Friend gives you money, you give your friend the gun.
Some states require that the purchaser in a situation like this be at least 21 for a handgun, others don't. Another poster will probably chime in with some links to state laws for you.