The logic is short enough to fit in a sentence, and the whole of his theology follows from it: the sun sees everything, therefore the sun is the judge. Utu in Sumerian — the word also means "sun" and "day" — and Shamash in Akkadian, cognate with the Hebrew shemesh and the Arabic shams, so this is one of the few Mesopotamian divine names an ordinary speaker of a modern Semitic language can read without help. The Sumerian by-name Babbar means "shining white".
On cylinder seals he is unmistakable. Rays rise from his shoulders like blades, and in his hand is a šaššaru, a saw with a curved, toothed edge. The saw is not for cutting wood. He uses it in the dawn scenes to cut open the twin mountains and step through, and in the courtroom vocabulary of the hymns a verdict is cut rather than pronounced — the same verb, in Akkadian as in the Sumerian before it. The instrument and the judgement share a word.
The Sippar tablet, and how a god was recovered
His two great temples were both called E-babbar, the white house, and stood at Sippar in the north and Larsa in the south. From Sippar comes one of the most extraordinary objects in the British Museum: a stone tablet of the ninth century BCE, made for King Nabu-apla-iddina, showing the god seated in his shrine, an enormous solar disc resting on a stand before him, ropes in the hands of attendants steadying it. The accompanying text explains that the old cult statue had been lost when raiders sacked the city generations earlier, that priests had been making do with a symbol, and that a terracotta model of the original was then found in the rubble and used to make a proper replacement. Two centuries later still, Nabopolassar's men found that tablet, made clay impressions of it, and reburied the lot in a box — where excavators found tablet, box and moulds together in 1881. It is a documented three-stage act of religious restoration, complete with its own paperwork.
Justice as an actual practice
The literature is unusually specific about what his justice consisted of, and it is not cosmic. The Great Hymn to Shamash, around two hundred lines in Akkadian, works through cases: the merchant who uses a light weight, and the one who uses an honest one; the judge who accepts a present and perverts a case, and the one who refuses; the man who bears false witness; the traveller alone on the road; the debtor. It promises consequences in this life, not the next — there is no next, in this tradition's underworld — and its ethical content is closer to a wisdom text than to a hymn.
It is his authority that Hammurabi cites at the top of the great stele now in the Louvre. The king stands before the seated god, who holds out the rod and ring. That pair is worth getting right, because it is constantly described as a sceptre and a bracelet: it is much more probably a measuring rod and a coiled measuring line, the surveyor's kit, handed over as the emblem of exact and impartial measurement rather than of raw power. A law code presented as a gift of accurate measurement from the sun is a coherent piece of design.
Two practical institutions ran through him. Oaths were sworn in his name and in front of his symbol, which made perjury a matter for the god rather than the court. And extispicy — reading the liver of a sacrificed sheep, the central divinatory technique of the whole civilisation — was addressed jointly to Shamash and Adad as the lords of divination, with the question put in writing and the answer read off the organ.
Nights underground, and a gate in the mountains
The daily circuit is a journey with named furniture. He rises through the gates of the twin mountain, called Mashu in Gilgamesh, whose gate is guarded by the scorpion-people — a man and his wife, whose terror is described at length when Gilgamesh arrives asking to use the passage. His charioteer is Bunene; his wife is Aya, goddess of dawn, whom the hymns ask to intercede with him on the worshipper's behalf; and his attendants are Kittu and Misharu, whose names mean truth and justice, personified as officials because that is how a Mesopotamian imagined abstractions getting anything done.
At night he crosses the interior, and the texts are matter-of-fact that this is when he judges the dead — the sun passes through the land of no return on its way to the east and hears cases there. That gives the underworld a visiting magistrate without giving it a system of reward and punishment, and the two ideas coexist in the sources without being reconciled.
Why he shows up in every other story
He is the tradition's most reliable ally, which for a Mesopotamian god is unusual. He champions the cedar expedition, sending thirteen winds against Humbaba to pin him down. He is the one who rebukes the dying Enkidu for cursing the woman who made him human. He gives the shepherd-god Dumuzid the form of a gazelle to escape the demons. In the Sumerian poems he is Inanna's brother and hears her complaints. A god defined by seeing everything is structurally useful in a story: he is the character who can be appealed to from anywhere.
From omen list to birth chart
Solar observation in Babylonia was not idle. The Enuma Anu Enlil series, seventy tablets of celestial omens, includes a long run of solar and eclipse omens, and the whole apparatus of watching the sky for royal warnings evolved, in the later centuries of cuneiform, into something new — the personal birth horoscope, of which the earliest examples yet found are Babylonian and date to the fifth century BCE. The sun's position at birth is the anchor of every horoscope written since, and the reason it is there rather than somewhere else is a chain of scribal practice that begins with tablets kept in this god's temples. How that inheritance travelled is followed on the myths behind the zodiac.
Loose ends about the sun
How does he compare with Ra or Helios?
He is far less of a creator and far more of a magistrate. Egyptian solar theology makes the sun the origin and continuing engine of the world, fought over nightly and reborn each morning; Mesopotamian solar theology makes him a senior official with a fixed route and a caseload, junior to Anu and Enlil and never head of the pantheon. The sun gods compared page sets the differences out; the short version is that Mesopotamia's most important sky god is the moon, not the sun.
Why is his sister a goddess of Venus and his father the moon?
Because the family is astronomical before it is genealogical. Nanna the moon fathers the sun and the morning star, which arranges the three most conspicuous objects in the night and dawn sky into a household. Where the poems make Inanna a daughter of Anu instead, an equally good case can be made — and the god-lists preserve both, as the Mesopotamian family tree shows.
Was the sun ever female here?
Not in Sumer or Babylonia. But in Anatolia, next door and in constant contact, the Hittites' chief deity was the Sun Goddess of Arinna, and Shamash's own name was used for her in some Hittite writing — so a scribe in Hattusa could write this god's name and mean a queen. Divine gender in the ancient Near East follows the local cult, not the astronomical object.