Rhiannon appears in the medieval Welsh tales known in English as The Mabinogion, a name usually given in translation to the ‘Four Branches’ of Y Mabinogi together with other tales, including ‘Culhwch and Olwen’ which is generally regarded as the oldest tale in the collection.
The presentation of Rhiannon emphasises different aspects of her character in different tales. In ‘Pwyll Pendefig Dyfed’ she arrives mysteriously on her horse from the Other World. Those who approach her find she gets further away the closer they get:
As they were sitting on this hill a woman dressed in shining gold brocade and riding a great pale horse approached the highway which ran past them. Anyone who saw the horse would have said it was moving at a slow steady pace as it drew adjacent to the hill. “Men,” said Pwyll, “does anyone know that horsewoman?” “No, lord,” they answered. “Then let someone go and find out who she is.” A man rose to go after her but by the time he reached the highway she had already gone past. He tried to follow her on foot, but she drew farther ahead of him. When he saw his pursuit was in vain he returned and told Pwyll, “Lord, it is pointless for anyone to follow her on foot.” “All right. Go to the court and take the fastest horse you know and go after her.” The man fetched the horse and set out after her. Once he reached open country his spurs found his mount, but no matter how much he urged the steed onward the farther ahead she drew, all the while going at the same pace as before…..
“There is some magical meaning to this”, said Pwyll.
Once she is persuaded to stop she proposes to Pwyll that she should become his wife. Later she instructs Pwyll how to outwit Gwawl, the man her father wants her to marry.
In the second part of the tale her role seems on the surface to be different. She is falsely accused of murdering her child and has to do a penance of offering to carry visitors on her back like a horse. She bears this without complaint until her innocence is discovered. But her association with horses is again emphasised here.
It is emphasised again in the tale ‘Manawydan fab Llyr’ where she is married to Manawydan and is captured in an enchanted castle and made to wear the collars of asses about her neck. Here it is Manawydan who displays magical cunning and ensures her release.
There is an allusive reference in the tale ‘Branwen Ferch Lyr’ where those returning from Ireland (including Manawydan) are soothed by the sweet sounds of the Birds of Rhiannon: “…there came three birds and began to sing them a certain song, and of all the songs they had ever heard each one was unlovely compared with that. And far must they look to see them out over the deep, yet was it as clear to them as if they were close by them; and at that feasting they were seven years”.
In ‘Culhwch and Olwen’, these birds are referred to as “they that wake the dead and lull the living to sleep”.
In these last two quotations Rhiannon appears not as a character in the tales but an Otherworld presence whose birds sing a haunting song from over the sea, a song that has the power to suspend time and cross the boundaries between the worlds.
W. J. Gruffydd whose studies of Y Mabinogi included a volume entitled Rhiannon in which he attempted to reconstruct what he perceived to be the original myth upon which the material in the First and Third branches of Y Mabinogi was based, though, he suggested, incompletely understood by the author or redactor of the tales. A synopsis of his argument for the development of Rhiannon from *Rigantona is on This Page->.
More recent work by Catherine Mckenna on Rhiannon as a sovereignty goddess usefully discusses the tales in the context of what she sees as a Celtic sovereignty myth involving Rhiannon as the Goddess whom both Pwyll and later Manawydan must wed in order to legitimate their right to rule. Such a theme, she suggests, is entirely consistent with regarding the text as conveying “the growth to full and effective lordship over Dyfed of its protagonist, Pwyll, and as a mirror or exhortation for medieval Welsh princes”. This approach regards the author/redactor of the tale as being fully aware of the mythical significance of its origins and putting them to appropriate contemporary use. In a later article McKenna extended her analysis to Manawydan-> in the Third Branch.
More easily available to the general reader is The Mabinogi and other Medieval Welsh Tales by Patrick Ford  which has a useful introduction in which he asserts that if “the integrity of the text” is to be respected we should regard the mythological elements contained in that text as at least being available to the medieval redactor(s) rather than take the view of Matthew Arnold that they were “pillaging an antiquity of which they scarcely possessed the secret”. He also suggests that the Third Branch (Manawydan) “preserves the detritus of a myth wherein the Sea God mated with the Horse Goddess”. He does not think that this myth survived into the tale as a myth, but that “the mythic significance may well have been understood in a general way by an eleventh century audience”. Such an understanding is also implied by McKenna’s argument.
Ford developed these themes further in a later article. He argues for a reading that understands that narrative need not only be horizontal but that a mythical reading also  needs to look at vertical parallels elsewhere in the text. Such a mythical reading here requires us to regard, for example, the events in the First Branch where Gwawl is the ‘badger in the bag’ and those in the Third Branch, where Manawydan has a mouse in a glove, as mythically parallel events while also being different events in the narrative scheme. Similarly, Pryderi’s disappearance at the same time as Teyrnon’s foal in the First Branch, and Rhiannon’s displacement to the horse block, and the disappearance of Pryderi and Rhiannon in the enchanted fort in the Third Branch, are to be seen as mythically parallel expressions of the same theme of cyclic fertility of the land worked out in different narrative elements in the text.
Pryderi, son of Pwyll and Rhiannon and stepson of Manawydan is, in the mythical dimension, the offspring of Other World parents who are also, in the narrative scheme, characters in a medieval tale. The contemporary narrative is necessary for the multiple expression of the mythic themes. Ford concludes:
“We need not search for an Ur-myth, nor need we assume that the text is corrupt or that the medieval redactor and his audience were ignorant of their traditions. The analysis attempted here shows that the first branch and part of the third branch of the Mabinogi are concerned, among other things, with the birth of Pryderi and his loss and return, the latter events paralleled by loss and restoration of fertility in the land. Was Pryderi human or divine? Who was his father? Because Pryderi is a divine hero, his father was Lord of the Otherworld. In Celtic tradition, the Lord of the Otherworld is pre-eminently the sea-god. When he mates with the Great Queen, he partakes of her characteristic shape, which is equine. Pryderi is a hero among mortal men, though his origins are divine; the narrative concerning his birth reflects, therefore, the natural and supernatural conditions attendant upon that event. He is at once son of the mortal Pwyll, Prince of Dyfed, who is also known as Lord of the Otherworld, the son of Teyrnon Twrf Liant (‘Lord of the Tempestuous Sea’), who is the mare’s consort, and the son of Rhiannon, Queen of Dyfed, whose equine nature is skilfully divided among several narrative sequences.”(*)
While Gruffydd’s approach saw the texts as having developed from earlier mythical material which he attempted to reconstruct, McKenna and Ford adopt an  approach which allows inherited mythic elements to shine through the analysis of the medieval text without reconstructing it.
W J Gruffydd Rhiannon (1953)
Patrick Ford Y Mabinogi and Other Medieval Welsh Tales (1977, & reissued 2007)
*Patrick Ford ‘Prolegomena to a Reading of The Mabinogi’ Studia Celtica Vol.16-17  (1981-82)
Catherine McKenna ‘The Theme of Sovereignty in Pwyll’ Bulletin of the Board of Celtic Studies Vol 29 (1980)
Catherine McKenna ‘Learning Lordship : The Education of Manawydan’ in Ildanach Ildirech eds Carey, Koch and Lambert (1999)
Online texts of the The Mabinogion and critical discussion can be found HERE