Before I read the post, I was leaning towards Helping a friend, since in general relationships are important to humans.
With the premise of a take-home test (or quiz, or whatever), though, the answer changes. Follow The Rules.
Getting a good grade is only cheating yourself (aside from also just plain cheating) if not by your mastery of the topic. I once had the answers version of a grade school math book, and used it daily to 'simplify' doing the homework. I didn't learn the math, and that ended up hurting me academically for a few years afterward.
If you want to provide the most help to a real friend, let them do it themselves. That way, they either really learn the material (which will help them) or they will get a bad grade (which will inform the teacher that the student needs help). If you don't care about the person and wish them evil (I hope not

) then by all means give them the answers - that will hurt them more than almost anything else you can do.