The old-fashioned adverb fain describes the manner of gladly or willingly doing something. You would fain have stayed home, but you had to venture out in the rain.
Fain comes from the Old English fægen, meaning "happy, glad, or well pleased." When you're fain to do something, you are happy to do it, like when you're exhausted and would fain take a nap. Sometimes fain is also used as an adjective to describe someone obligated or willing to do something: "He was fain to hand over half the lemonade stand money to his little brother."