He fights in the first battle of Mag Tuired, when the Tuatha Dé take Ireland from the Fir Bolg. Under the reign of Bres, when the Tuatha Dé are reduced to servitude, Ogma is forced to carry firewood, but nonetheless is the only one of the Tuatha Dé who proves his athletic and martial prowess in contests before the king. When Bres is overthrown and Nuadu restored, Ogma is his champion. His position is threatened by the arrival of Lugh at the court, so Ogma challenges him by lifting a great flagstone, which normally required eighty oxen to move it, and hurling it out of Tara, but Lugh answers the challenge by hurling it back. When Nuadu hands command of the Battle of Mag Tuired to Lugh, Ogma becomes Lugh's champion, and promises to repel the Fomorian king, Indech, and his bodyguard, and to defeat a third of the enemy. During the battle he finds Orna, the sword of the Fomorian king Tethra, which recounts the deeds done with it when unsheathed. During the battle Ogma and Indech fall in single combat, although there is some confusion in the texts as in Cath Maige Tuired Ogma, Lugh and the Dagda pursue the Fomorians after the battle to recover the harp of Uaitne, the Dagda's harper.
He often appears as a triad with Lugh and the Dagda (The Dagda is his brother and Lugh is his half-brother), who are sometimes collectively known as the trí dée dána or three gods of skill, although that designation is elsewhere applied to other groups of characters. His father is Elatha and his mother is usually given as Ethliu, sometimes as Étaín. His sons include Delbaeth and Tuireann. He is said to have invented the Ogham alphabet, which is named after him.
Scholars of Celtic mythology have proposed that Ogma represents the vestiges of an ancient Celtic god. By virtue of his battle prowess and invention of Ogham, he is compared with Ogmios, a Gaulish deity associated with eloquence and equated with Herakles. J. A. MacCulloch compares Ogma's epithet grianainech (sun-face) with Lucian's description of the "smiling face" of Ogmios, and suggests Ogma's position as champion of the Tuatha Dé Danann may derive "from the primitive custom of rousing the warriors' emotions by eloquent speeches before a battle", although this is hardly supported by the texts. Scholars such Rudolf Thurneysen and Anton van Hamel dispute any link between Ogma and Ogmios.
- J. Fraser (ed. & trans.), "The First Battle of Moytura", Ériu 8, pp. 1-63, 1915
- R. A. S. Macalister (ed. & trans.), Lebor Gabála Érenn: Book of the Taking of Ireland Part 4, Irish Texts Society, 1941; Whitley Stokes (ed. & trans), "The Second Battle of Moytura", Revue Celtique 12, pp. 52-130, 306-308, 1891; Vernam Hull (ed. & trans), "Cairpre mac Edaine's Satire Upon Bres mac Eladain" Zeitschrift für Celtische Philologie 18, 1930
- Stokes 1891, pp. 81, 83, 109; A. H. Leahy (ed. & trans), "The Wooing of Étain" §18, Heroic Romances of Ireland Volume II, 1902
- Fraser 1915, §49; Stokes 1891, p. 77
- Stokes 1891, p. 69
- Macalister 1941, §64
- Tom Peete Cross & Clark Harris Slover (eds.), "The Fate of the Children of Turenn", Ancient Irish Tales, Henry Holt & Co, 1936, p. 49
- James MacKillop, Dictionary of Celtic Mythology, Oxford University Press, 1998, p. 310
- J. A. MacCulloch, The religion of the ancient Celts. New York: Dover Publications, 1911, Ch. V. ISBN 0-486-42765-X