This story can be found in the Poetic Edda where it is titled Hyndluljˇ.
A man, Ottar, was in a competition of some sort. The winner of the competition would be the contestant who could trace his lineage back the farthest. Ottar made offerings to Freya and prayed for her help in winning the contest. Freya heard his prayers and came to him. She caused him to assume the shape of a boar and then used him as a steed. Freya then rode Ottar to the cave of the gaintess Hyndla. Freya then bid Hyndla to ride with her to Valhalla and "to match lore of lines of lordly races, of the kin of kings who came from the gods." Freya told Hyndla of Ottar's wager and his offerings. Hyndla then recites Ottar's lineage back through many generations. Freya then bid Hyndla bring her (Freya's) boar a cup filled with a drink that would enable him to keep all the words he had heard in his mind until on the third morning when he would recite the words at the competition. Hyndla brought the cup and then bid Freya be on her way, but not before accusing her of pretending to be faithful to Od while accepting other lovers. Freya then caused Hyndla to be hedged by fire such that she would not be able to escape unscathed. Hyndla then told Freya "in the beaker bear thou the beer to Ottar, with venom brewed: may it work thy bane!" Freya responded that her (Hyndla's) wicked wish would work no harm, and that Ottar would drink the goodly draught and may all gods then lend Ottar help.