A heroic man accepts an ugly woman despite her appearance, and then she transforms to become beautiful, for his actions broke a curse.
It's a common motif in medieval storytelling - and often, the choice of what the hero has to do sheds some light on the society's concept of gender.
Helgi, brother of Hrolf Kraki and Hroarr (who are known in the Old English tradition as Halga, Heorogar, and Hrothgar, the last of these the Danish king of Beowulf fame), was the only man in the kingdom willing to invite a hideous hag into his house on a cold night and allow her the warmth of his bed. As she lay down he saw her for her true form - a beautiful elf maiden.
In the Irish tradition, Diarmuid Ua Duibhne (a Fianna warrior) was the only one willing to give so much as a blanket to an ugly woman who entered the hall on a cold and rainy night; Diarmuid's bed was the closest to the fire, but he gave it up for her. In the morning he woke to see her beautiful, and the two were married.
Though the reward in these cases is a shallow one, it's earned by looking after the welfare of women, with no expectation of getting anything back for it. The motif goes a little further in the British tradition.
King Arthur (we are told in a Middle English poem, The Wedding of Sir Gawain and Dame Ragnelle) was challenged by a Sir Gromer to determine what it is women most want, or else Gromer would cut off his head. Despairing, he turned to his nephew, Sir Gawain, who suggested that the two ride through the land collecting answers from different women. This they did, but no two agreed on the answer - some said jewelry or clothing, others fame, others pleasure in bed, and so forth. Ultimately, Arthur went into the wood and was preparing to meet his fate when he encountered an ugly old hag, Dame Ragnelle (sister of Sir Gromer). She offered to tell him the answer, on the one condition that she be able to marry Sir Gawain. Arthur agreed.
Arthur gave Dame Ragnelle's answer to Sir Gromer: women desire the freedom to make their own decisions. Sir Gromer accepted this answer, and Gawain married. After the wedding, the couple retired to their bedchamber, where Dame Ragnelle was suddenly stunningly beautiful. She explained to Gawain that she was cursed to be ugly, but that he has broken half the curse and she will now have one form by day and the other by night.
Dame Ragnelle asked Sir Gawain whether he would prefer her lovely by day to show off to his friends, or by night to please him in bed. Gawain didn't answer, at first - but thinking on what his bride had said to King Arthur about what women want most, he told her the choice was hers. This answer, she revealed, broke the rest of the curse, and thenceforth she would be beautiful all day and all night.
A version of this story appears in Chaucer's Wife of Bath's Tale, as well, though in this case the woman tells the knight only that women wish to be sovereign in matters of love. The distinction reflects a radically different attitude between the two authors about the extent to which women ought to defer to men, and the Chaucerian version also differs in another way that highlights the differing perspectives. Chaucer's hero is a rapist, a knight who has been told by Queen Guinevere that he can escape the punishment for his crime if he learns his lesson by finding out what women desire. In this version the ugly Allison is also offering the knight a choice of whether she will be ugly (always), but thus undesirable to other men, or beautiful but unfaithful. He offers her the choice, and is again rewarded with a beautiful bride who remains faithful. (Chaucer puts this story in the mouth of one of only three female narrators in his Tales.)
Although the overall plot - a knight marries an ugly woman in exchange for the lesson that women desire sovereignty, then finds his wife beautiful because he applied the lesson and let her make her own choice - is the same, these differences reflect two very different medieval ideas about the place of women in society. Dame Ragnelle speaks to a vision of women who, while perhaps not sovereign in the world as men are, are still masters of their own destinies; Allison simply asks for the sphere of marriage and love to belong to women, and lets a rapist off the hook when he embraces this idea. Even this version of the story, of course, represents the growing chivalric ideal which puts love and women on a pedestal.
In the end, the Irish Diarmuid learns the lesson about female sovereignty as well - although he earned his bride as a reward for heroic hospitality, she gives him lands and a castle and a fine grayhound on the condition that he never speak of how ugly he was when they first met. He mentions it to her three times, and on the third occasion the castle and grayhound vanish. He then searches for her and finds her in the Otherworld, and swears to love her no matter what conditions she imposes. (His love for her fades in the end, however, as he can no more live fully in her world than she in his.) This message, that women desire some measure of control in their lives, is thus echoed even in some versions where it isn't the centerpiece of the tale.