Varuṇa — ṛta, and the oldest idea of an order that binds
The popular claimBefore there was karma there was ṛta, and Varuṇa was the one who kept it.
There is a hymn in the seventh maṇḍala, 7.86, in which the poet Vasiṣṭha asks Varuṇa what he has done wrong. What was my chief sin, Varuṇa, that you wish to slay your friend, your singer? He does not know; he asks to be told; he says that it was not his own will but wine, anger, dice, thoughtlessness, and that even sleep leads to wrong. There is nothing else like it in the Ṛgveda, and it is why Varuṇa matters.
Ṛta
Before dharma, and older than karma, the Ṛgveda has ṛta: the order of things — the course of the sun, the sequence of the seasons, the truth of speech, the correctness of the sacrifice — all one word, and all one thing. Ṛta is what is; anṛta is the lie. Its keeper is Varuṇa. He fixed the sun's path; he made the rivers flow and the sea not fill; and he watches every human act, because human acts are also part of the order and a lie breaks it. The word ṛta is cognate with Latin ars and ritus and with English right, and the Avestan aṣa, Zoroastrianism's central principle, is the same word.
The god who sees
Varuṇa has spies — the Atharvaveda says they come from heaven and see the whole earth, and that two men sitting together plotting are known to him as a third. He knows the path of the birds, the ships on the sea, the twelve months and the thirteenth. He binds the one who breaks ṛta with his pāśa, the noose — the same noose that Yama later carries — and the disease he sends is dropsy, the body filling with water, the water being his. The hymns to him are the Ṛgveda's only prayers for forgiveness: loosen the upper, the middle and the lower bond, says Śunaḥśepa, tied to the sacrificial stake in the story the first maṇḍala's hymns come from.
Mitra and Varuṇa
He is nearly always paired with Mitra — Mitrāvaruṇā, a dual. Mitra is the contract, the friend, the daytime; Varuṇa the oath, the sovereign, the night. Dumézil built a theory of Indo-European kingship on the pair: the two faces of sovereignty, the lawful-benevolent and the magical-binding. The Vedic evidence supports at least this much: they are addressed together, they hold ṛta together, and where Mitra is trusted, Varuṇa is feared.
The demotion
In the earliest layer Varuṇa is samrāj, the sovereign, and Indra is a warrior. By the end of the Ṛgveda Indra has the sovereignty; there is a hymn, 4.42, in which the two argue over it, and the text is not sure who wins. By the Brāhmaṇas Varuṇa is the god of the waters. By the epics he is the lokapāla of the west, lord of the ocean, with a noose and a sea-monster for a mount, and no one prays to him for forgiveness anymore. The moral function passed to Yama and to the impersonal working of karma; the sovereignty passed to Indra and then to Viṣṇu and Śiva. Varuṇa was left the water. The tradition has a story for almost every god's rise; it has none for his fall. He simply recedes from hymn to hymn.
Why he still matters
The Vedic idea that the universe has an order which is also a moral order, and that a lie is a breach of the same order that a wrong sacrifice is, is the seed of everything the tradition later called dharma. That idea has Varuṇa's name on it. And the Ṛgveda's few hymns of personal guilt — the ones in which a man asks what he has done, and asks to be released — are all his.
What this page does not say
It does not say Varuṇa punishes anyone now, or that a rite to him does anything, and it does not rank the theory of his demotion above the alternatives, which exist. It gives what the hymns say, what ṛta meant, how he was paired and how he was replaced. The reader who has met him only as the god of the sea now knows what he was before the sea was all he had.
Source — Rigveda 1.24–1.25 (Shunahshepa's hymns), 2.28, 5.85, 7.86–7.89 (Vasishtha's Varuna hymns); the Atharvaveda 4.16 on Varuna's spies; the Mahabharata and Puranas for the later Varuna as lord of waters; Georges Dumezil's and Jan Gonda's studies on Mitra–Varuna
Every claim on this site names its source, and every calculator shows its arithmetic.