The primeval conflict myth is a staple of Greek, Hittite, Canaanite, Babylonian, and even Hindu myth, and the Canaanite version appears throughout the OT and even turns up in the Christian apocalypse of Revelation. This post will survey the literary evidence of the myth in the Bible and in ancient literature.
There are two types of conflict myth. The first relates to the act of creation. In the ancient Near East, creation was not viewed as the creation of matter from nothingness but rather the reordering of chaos. Chaos typically has two chief charateristics: (1) water, especially the roiling waters of the sea, and (2) darkness. Both properties were embodied in a chaos monster, usually depicted as a serpent or dragon either living in the sea or who is the sea. The creator god then fights the monster and divides its body into parts which he fashions into the different aspects of creation. The second type of myth relates not so much to creation but to authority and kingship. The gods -- especially patron deities -- often vie for supremacy and fight each other in battles that evoke the original battle of creation. It is important to understand that in ancient Canaan and Phoenicia, the king was viewed as co-regent of the patron god who rules from heaven, and conflicts on earth are viewed as reflections of conflicts in heaven. In Canaanite mythology, the father god El begat seventy sons (cf. KTU 1.4 vi 46, "the seventy sons of Asherah," El's consort), and in the OT we find that El assigns one god to each nation as their patron deity, Yahweh inheriting Israel:
"When Elyon (an epithet of El) apportioned the nations, when he divided mankind, he fixed the boundaries of the peoples according to the number of the sons of El. Yahweh's portion was with his people, Jacob his share of inheritance." (Deuteronomy 32:8-9)
That is why there are seventy nations listed in Genesis 10, one nation for each god. When Judaism became monotheistic, this notion was adjusted so that each nation had their own guardian angel (cf. Daniel 10:13, 20, 21; 12:1; Sirach 17:17). Thus we read in the Targum Ps.-Jonathan that "when he [i.e. God] divided alphabets and tongues to the sons of men [at the Tower of Babel], he cast lots with 70 angels, the princes of the nations, who established the borders of the peoples." In this later tradition, Michael became the patron angel for Judah (and eschatological Israel), and this fact is of vital importance for understanding the conflict myth in Revelation. But for the time being, let us consider the conflict between Yahweh and Chemosh, which was realized in the earthly conflict between the Israelites and the Moabites. The old polytheistic notion of the different gods establishing the borders between the nations can be found in Judges 11:23-24 where Jephthah says:
"Now since Yahweh, the god of Israel, has driven the Amorites out before his people Israel, what right have you to take it over? Will you not take what your god Chemosh gives you? Likewise, whatever Yahweh our God has given us, we will possess." (Judges 11:23-24)
Thus when Moab is defeated in war, the Israelites say that "Chemosh goes into exile" (Jeremiah 48:7), while the Moabites viewed their own political fortunes as dictated by their god Chemosh as well: "Omri was the king of Israel, and he oppressed Moab for many days, for Chemosh was angry with his own land.... And Chemosh said to me, 'Go take Nebo from Israel!' And I went in the night and fought against it from break of dawn until noon, and I took it, and I killed its whole population ... and from there I took the vessels of Yahweh and hauled them before the face of Chemosh" (King Mesha Stele, COS 2.23, lines 5-6, 14-18). Moreover, when Israel "serves gods that were no part of their heritage" (Deuteronomy 29:24-27), Yahweh becomes jealous that "they have forsaken me and worshipped Ashtoreth the goddess of the Sidonians, Chemosh the god of the Moabites, and Molech the god of the Ammonites" (1 Kings 11:33), instead of following the god allotted to their nation. That is also why Ezekiel and the other prophets explain Israel's destruction by the Assyrians and Judah's destruction by the Babylonians as the result of their religious "apostasy" -- by turning to the gods of other nations, Yahweh abandoned his political support and left them defenseless to the forces of the Assyrians and Babylonians.
Having laid out these basic concepts, let me go on to discuss the two types of conflict myth in the Bible and in near Eastern literature.
THE CONFLICT MYTH AS COSMOGONY
The Ugaritic cycle of myths do not present a creation myth on the origin of the cosmos. They present a world and cosmos already existing, which Baal and the other gods help maintain. They are less interested in primeval history than contemporary relations between the gods, especially as they relate to kingship and theocracy. But we see traces of a creation myth of El as the creator of the cosmos. Two of El's titles are 'ab 'adm "father of humanity" and bny bnwt "creator of creatures," while his consort Asherah is qnyt 'ilm "creatress of the gods" (cf. the Yahwist creation account where bn is used of Yahweh to describe his creation of Eve in Genesis 2:22 and qnh is used of Eve to refer to her creation of man in Genesis 4:1). The Keret Epic also has El announcing that he would "act as the craftsman" and create an expeller of disease; he then "fashioned out of moistened clay" Sha'taqat (KTU 1.16 V 23-30), exactly the language of the creation of humanity in Akkadian, Egyptian, and Hebrew literature (cf. the Gilgamesh and Atrahasis epics, the legend of Khnum, Isaiah 64:7; Job 33:6). As for the creation of the cosmos, El's abode is given as the "source of the Double-Deeps" (cf. also Ezekiel 28:2), which might reflect an earlier conflict myth involving El; a similar situation can be found in the Babylonian Enuma Elish where Ea (the equivalent of El) first battles and defeats the watery Apsu (cf. Greek abussos, whence "abyss") which he makes his abode, foreshadowing a later battle by Marduk (the equivalent of Baal) against Tiamat. Mark Smith suggests that the myth of Baal's battle against Yamm (Sea) in the Baal Epic reuses motifs from an older unattested theogony in which El creates the cosmos upon defeating the primordial waters of chaos. This notion is found throughout a wide range of cosmogonies and theogonies of the ancient world, such as the Greek notion of the cosmos-encircling Okeanos as the "genesis of all" (cf. Hesiod, and the Illiad), and Egyptian myths give the epithet "father of the gods" to the primeval waters and depict creation as the growth of a hill called Ta-tenan "Rising Land" emerging from the waters of chaos (cf. COS 1.13).
The best known example of the conflict myth in cosmogony can be found in the Enuma Elish which relates two conflicts: an early one between Ea and Apsu, the consort of Tiamat, and a later one between Ea's son Marduk and Tiamat. While Ea only creates his abode and Marduk from the remains of Apsu, Marduk forms the entire cosmos from Tiamat's carcass. Tiamat is pictured as a watery serpentine beast, with a long tail and scales which are riled up into waves when the wind blows. The primeval battle is related as follows:
"Tiamat and Marduk, sage of the gods, drew close for battle, they locked in single combat, joining for the fray.... He shot off the arrow, it broke open her belly, it cut her innards, it pierced her heart. He subdued her and snuffed out her life, he flung down her carcass, he took his stand on it. After the vanguard had slain Tiamat, he scattered her forces, he dispersed her host.... The Lord trampled upon the frame of Tiamat, with his merciless mace he crushed her skull" (Enuma Elish, COS 1.111, IV.93-130).
This account involves the motifs of shooting arrows, trampling the monster's carcass, and crushing its skull with his mace. Then Marduk cuts open her body, dividing it in half, and fashioning its organs and parts as his works of creation:
"The Lord was inspecting her carcass that he might divide the monstrous lump and fashion artful things. He split her in two, like a fish for drying, half of her he set up and made as a cover, heaven. He stretched out the hide and assigned watchmen, and ordered them not to let her waters escape. He crossed heaven and inspected its firmament....He established in constellations the stars, their likenesses. He marked the year, described the boundaries.... In her liver he established the zenith. He made the moon appear, entrusted to him the night.... He set down her head and opened underground springs, a flood was let flow, from her eyes he undammed the Euphrates and Tigris. He stopped up her nostrils and heaped up high-peaked mountains from her dugs. He drilled through her waterholes to carry off the catchwater. He coiled up her tail and tied it as the Great Bond. He set her crotch as the brace of heaven, spreading half of her as a cover, he established the netherworld" (Enuma Elish, COS 1.111, IV 135 - V 62).
Throughout this account we see an ordering of chaos, the setting up of boundaries, natural laws, and divisions. Marduk put limits to Tiamat's waters and used her waters to create springs, rivers, and waterholes. The stretching out of heaven like tent hide is also a motif encountered throughout the OT (cf. Job 9:8; Psalm 104:2-3; Isaiah 40:22, 42:5, 44:24, 51:13; Jeremiah 10:12, 51:15; Zechariah 12:1) The Priestly account of creation in Genesis 1 appears to be a demythologized version of the Tiamat legend. The Hebrew cognate of Tiamat is tehom "deep" which denotes the initial state before creation: "The earth was a formless void (thw-w-bhw), there was darkness over the deep (thwm), and the wind of God hovered over the water" (Genesis 1:2). We have no explicit notion of a personalized chaos monster but we have the primordial existence of "darkness" and the "deep", the same two traits of chaos in Greek myth and in the Enuma Elish. The mention of wind blowing over the thwm waters is also reminiscent of young Marduk sending winds upon Tiamat, causing waves and "roiling Tiamat, churning day and night" (I 105-109). Then in the Hebrew version, God "divides the waters in two," just as Marduk splits Tiamat's carcass in two, and places half of the waters above the firmament, creating heaven (1:6-8). This is exactly how Marduk creates heaven. Then God makes "the waters under heaven come together into a single mass," creating land (v. 9-10). He also subsequently creates the moon and stars in heaven (1:14-19), which mark the days and months and years. For more explicit mention of method of creation, we need to look at poetic cosmogonies outside of Genesis. The creation account in Job 38 is notable for describing the setting up of boundaries on the sea:
"Where were you when I laid the earth's foundations?... Who pent up the Sea (= Yamm) behind closed doors when it leapt tumultuous out of the womb, when I wrapped it in a robe of mist and made black clouds its swaddling bands; when I marked the bounds it was not to cross and made it fast with a bolted gate? 'Come this far,' I said, 'and no farther. Here your proud waves shall break.' " (Job 38:4, 8-11)
The notion is exactly that of the Enuma Elish which relates how Marduk placed Tiamat's waters under guard and "ordered them not to let her waters escape". Although the Sea is not explicitly personified as a monster in this passage, it is characterized as such in Job 7:12:
"Am I the Sea (ym), or the dragon of the Sea (ym-tnyn), that you should keep me under watch and guard?" (Job 7:12)
The actual battle itself is described in Job 26:13, but I will reserve this text for later because it does not specify when the battle took place. The cosmogony in Proverbs 8 similarly describes bounding of the Sea in creation, when Yahweh "fixed fast the springs of the deep (thwm), when he assigned the Sea (ym) its boundaries so the waters will not invade the shore" (8:28-29). Jeremiah 5:22 says that Yahweh "set the sands as limit to the Sea, as an everlasting barrier it cannot pass. It storms but can do nothing, its waves may roar but do not pass beyond". Another creation narrative occurs in Psalm 104. We first read how Yahweh "stretches the heavens out like a tent, builds his palace on the waters above" (Psalm 104:2-3). This recalls the Enuma Elish where Ea builds his palace on the waters of Apsu, and how Marduk stretches the hide of Tiamat to create the heavens. It also evokes the Canaanite concept of El's heavenly palace lying "at the springs of the Two Rivers, at the meeting-place of the Double-Deeps" (mbk nhrm b'dt thmtm, KTU 1.100.2; compare KTU 1.2 III 4-5; Psalm 42:7-8; Ezekiel 28:2; Quran, Sura 18:60). The creation account goes on to describe how Yahweh created land by placing the "deep" (thwm) into its proper place:
"You fixed the earth on its foundations, unshakeable forever and ever; you wrapped it with the deep (thm) as with a robe, the waters overtopping the mountains. At your reproof the waters took to flight, they fled at the sound of your thunder, cascading over the mountains, into the valleys, down to the reservoir you made for them; you imposed the limits they must never cross again, or they would once more flood the land. You set springs gushing in ravines, running down between mountains, supplying water for wild animals, attracting the thirsty wild donkeys... from your abode you water the uplands." (Psalm 104:5-11, 13)
In this text we have a consolidation of properties of El and Baal in Yahweh who both creates the world and maintains it. The description of the palace at the source of the waters is that of El and the description of watering the land and providing thunder is that of Baal. It is unclear whether Baal acquired El's creative powers before becoming subsumed within Yahweh, or whether Yahweh separately combined these traits of El and Baal. In either case, we find within Yahweh an ongoing conflict with the Sea that extends from creation itself to the present day.
There is one late Jewish text in the Talmud however that amazingly refers to the cosmogonic conflict myth and evidently preserves some very old Canaanite traditions on the creation of the cosmos:
"When God desired to create the world, he said to the Prince of the Sea (sr' sl ym), 'Open your mouth and swallow up all the waters of the world!' The latter answered, 'Lord of the universe, I have enough with my own!' Whereupon God trampled on him and slew him, as it is said, 'By his power he beat down the Sea, and by his understanding he smote Rahab.' " (b. B. Bat. 74b)
Here the biblical Rahab (not to be confused with the Jericho prostitute from Joshua!) is construed as the primeval chaos monster which God slew at creation. That this account preserves some actual memory of Canaanite myth can be seen in the epithet "Prince of the Sea," which derives from Yamm's epithet zbl ym "Prince Sea". Although Rahab was mentioned in the OT mostly in theogonic circumstances, the Talmud suggests that the original myth posited Rahab as the primordial chaos dragon.
THE CONFLICT MYTH AS SECURING DIVINE KINGSHIP
In the Baal Epic, the conflict between Baal and Yamm (the Sea) is conceptualized as a struggle for divine sovereignty. Prince Yamm is the beloved son of El, who rules over the earth and who has authority in heaven at the divine council. Baal is an outsider, the son of Dagan, who challenges Yamm and recruits the help of Anat, the goddess of war, and the craftsman-god Kothar who designs the lightning-bolt weapons that Baal would use in his battle. Then Yamm, joined by Judge Nahar (River), fight with Baal on Mount Zaphon (Mount Casius in Greek), and Baal smote his enemies, earning himself kingship in heaven and earth. Baal has his own palace built on Mount Zaphon and El recognizes his authority and adopts him as one of his sons (Baal is mlk "king" but El remains mlk mlkm "king of kings"), but Mot challenges his authority and Baal dies -- only to rise again after residing in Sheol with the dead. Reference is also made in the epic to an earlier battle between Baal and a similar chaos monster named Lotan.
As mentioned earlier, the battle may have originally been cosmogonic in nature but in the contemporary context it combines natural circumstances with religious and political developments. Baal as the storm-god was the bringer of rain, but in the natural world, storms sometimes unleashed floods that destroyed land and property, and turned drinking-water into brackish muddy liquid. In a sense, such floods were an undoing of creation and a breaking of the limits set to the seas and floods. Storms were thus viewed in Canaanite culture as battles between Baal and the forces of Yamm and Nahar (Sea and River), which most of the time Baal brought life and order but which Baal sometimes lost to the chaos unleashed. The motif of the death of Baal was also related to the seasonal lessening of rains by summer time and the drying up of produce throughout the land. But Mark Smith points out that this seasonal theme has been exaggerated and is only one facet of a more complex picture. The other major factor is that Baal was the patron deity of the Ugarit city-state, as well as among the Phoenicians and other city-states in Canaan. The kingship invested in their earthly rulers was viewed as an extension of Baal's authority in heaven. Defeat of such kings at the hands of other nations and/or worshippers of other gods was thus viewed also as the defeat and temporary death of Baal. The victory of Baal over Yamm could also be viewed in political terms as the victory of the Ugarit, Syrian, and Phoenician sovereignty over earlier Hittite and Hurrian domination. We can note, for instance, that the Hurrian-Hittite Song of Ullikumi contains the same motif of an older god's naming of a new divine champion to attack the storm-god:
"Kamarbi began to say to his soul: 'What name shall I give him? ... Let him go and let his name be Ullikummis! Let him ascend to heaven for kingship! Let him vanquish Kummiya, the beautiful city! Let him attack the Storm-god and tear him to pieces like a mortal! Let him tread him under foot like an ant!" (Song of Ullikumi, ANET 122).
The Hurrian capital of Mari (2250-1500 B.C.) had a well-attested cult to Yamm as a patron deity. Mari personal names include -ym as a theophoric element, including Abdiyamm "servant of Yamm," Ilyamm "Yamm is god," and a tablet from Tell Taanach also attests the name Ahiyamm "Yamm is brother". Evidence of offerings to the god d Ya-a-mi, the consort of d INANNA were also found at Mari, and there is some evidence that the Greek myth of Andromeda (< 'nt rmt "Queen Anat") reflects a Yamm cult on the Levantine coast. Old Babylonian texts from Mari also attest the existence of a male deity named Naru "River," such as the name Iti-Naru "the River knows". The memory of the old Hurrian empire that came before the native Canaanite and Phoenician city-states may have thus been enshrined in the myth of Yamm and Nahar as gods of an older generation defeated by young upstarts like Baal.
Yamm still existed however, as long as the Sea remained a natural reality and threat, and thus Ugaritic pantheon lists mention Yamm as one of the chief deities (KTU 1.47, 1.118). Even in Israel, Yamm was viewed as a real and living deity; rabbinical literature, for instance, forbade the slaughtering of animals in places where the blood could seep into lakes or rivers, lest the sr' dym "Prince of the Sea" accept such blood as an offering (b. Hul. 41b). The myths about the defeat of Yamm by Baal/Yahweh thus had an ongoing prescience, as the patron deity protects the land not only from military invasion but from natural enemies.
The battle between Baal and Yamm (joined with Nahar and their hosts) is described in the following manner in the Baal Epic:
"Drive Yamm away, drive Yamm from his throne, Nahar from the siege of his dominion....The mace whirls in Baal's hand like a hawk in his fingers, striking Prince Yamm on the head, Judge Nahar on the forehead. Yamm goes groggy, falls to the ground, his joints go slack, his body slumps. Baal grabs Yamm and sets about dismembering him, sets about finishing Judge Nahar off. By name Athtart reprimands him, 'Dry him up, O Mighty Baal, dry him up, O Cloud Rider, for Prince Yamm is our captive, for Judge Nahar is our captive.' Mighty Baal dries him up. Yamm is certainly dead." (KTU 1.2 IV 19-34)
As you may recall, Marduk also smashed the head of Yamm with his mace. In the case of Baal, his weapons were crafted by the craftsman-god Kothar. The same myth appears in thoroughout the Near East. In Greek mythology, Zeus (the warrior god, but who has a storm theophany) defeats the sea-monster Typhon on Mount Casius (the same mountain as Zaphon) with thunder-bolt weapons made by the craftsman-god Hephaestus (cf. Iliad 2:782f; Hesiod, Theogony 820f; Apollodorus, Bibl. I 5.3.7f). In Hittite mythology the Storm-god Teshub fights and defeats the serpentine enemy Ullikumi who arises from the sea, and first encounters him on Mount Hazzi -- the Hurrian name for Mount Zaphon. In Egyptian myth, the son god Re must defeat the dragon Apep (Apophis) on Mount Bakhu (where the sun sets in the west) who threatens to destroy the solar boat and return the world to a state of chaos (COS, 1.21). The legend even occurs in Hindu mythology. According to the Rig Veda, the storm-god Indra defeats the cosmic enemy Vrtra with the aid of weapons made by the divine artisan Tvashtr:
"I will declare the manly deeds of Indra, the first that he achieved, the Thunder-wielder. He slew the Dragon, then disclosed the waters, and cleft the channels of the mountain torrents. He slew the Dragon lying on the mountain: his heavenly bolt of thunder Tvastar fashioned.... Indra with his own great and deadly thunder smote into pieces Vrtra, worst of Vrtras. As trunks of trees, what time the axe hath felled them, low on the earth so lies the prostrate Dragon....Vrtra lay with scattered limbs dissevered. There as he lies like a bank-bursting river, the waters taking courage flow above him" (Rig Veda 1.32.1-2, 5, 7-8)
It is therefore not surprising to find the same myth in the Bible. It was used to dramatize Yahweh's power over the Sea, but more commonly over Israel's political enemies. Both themes converge in one single national event: the crossing of the Israelites through the ym sp "Sea of Reeds" and the destruction of the Egyptian army (Exodus 14-15; Psalm 78; Isaiah 51). It is the primeval conflict myth that invested the Sea of Reeds story with such powerful meaning in the minds of the Israelites and Judahites. The ideological polemic is clear: this was the event where Yahweh unquestionably proved himself to be the patron deity of the Israelites. Yahweh's storm theophany and actions in Exodus however are precisely that of Baal in Canaanite myth, which is why the Israelites are depicted as giving offerings to a golden calf in ch. 32; Baal was chiefly represented iconographically as a calf or bull (cf. 1 Kings 12:32; 2 Kings 10:29, 17:16). The older Song of the Sea in Exodus 15 dramatizes Yahweh's power over the Sea: "A blast from your nostrils and the waters piled high; the waves stood upright like a dyke; in the heart of the sea (ym) the deeps (thmt) came together" (15:8). The motif here is a reversal of creation myth of Tiamat (cf. plural thmt in v. 8), Yahweh gathers up all the waters together reconstituting the primeval "deeps". The later Priestly version of the story, however, directly patterned the event after the conflict myth: "Yahweh drove back the sea with a strong east wind all night, and he made dry land of the sea. The waters parted and the sons of Israel went on dry ground right into the sea, walls of water to the right and left of them" (14:21-22). (1) The motif of the sea being driven back recalls the act of creation in Psalm 104:5-11 where "the waters took to flight, they fled", as well as the Enuma Elish wherein Marduk "scattered her forces, he dispersed her host", and especially the reference in the Baal Epic to Baal "driving Yamm from his throne" (KTU 1.2 iv 20). (2) The second motif is the east wind, which recalls the wind blowing on the waters at creation (Genesis 1:2), and the first offensive act Marduk took against Tiamat was releasing an ill wind in her face which blew right through her body (Enuma Elish, COS 1.111 IV 96-99). Baal also has "winds" in his meteorological entourage, and in Hosea 13:14-15 the imagery of the east wind and death (i.e. Mot) stand together, which recalls how in the Baal Epic the sirocco winds are manifestations of Mot (KTU 1.4 vii 55-56) that "dry up" the agricultural bounty of Baal. Unlike Baal, Mot is part of Yahweh's entourage and works to "dry up" the adversarial waters. (3) The third motif of "drying up" the sea, creating "dry land" is also familiar from the creation myth (Genesis 1:9-10; Psalm 104:5-11), and Isaiah 44:27 where Yahweh says: "I, who said to the deep, 'Be dry; I will dry up your floods". It is also a motif from the battle with Yamm in the Baal Epic: "Athtart reprimands him, 'Dry him up, O Mighty Baal, dry him up, O Cloud Rider.... Mighty Baal dries him up." (4) The fourth motif is parting the waters into two halves. This again is a creation motif, as God "divided the waters in two" in Genesis 1:6, and similarly Marduk "split her [Tiamat] in two, like a fish for drying" in the Enuma Elish. The parting of the Sea of Reeds is thus an act evoking primeval cosmogony in a saving act that defines the god as the national patron deity -- as it simultaneously liberates a people from domination by another power (and by other gods, see especially Exodus 12:12 where Yahweh punishes the Egyptian gods) and gives them back their sovereignty as a political entity in their own right. The subsequent crossing of the Jordan River in Joshua 3:14-17 may represent a subsequent defeat of Judge Nahar from Canaanite myth.
Now that I've laid out the basic concepts, we are ready to examine the explicit OT references to the conflict myth which often allude to the exodus as the historical setting of the conflict. The chaos monster is variously referred to as (1) lwytn "Leviathan", (2) rhb "Rahab", and (3) ym "Yamm". The word tnn or tnnyn "dragon" is also used to describe it.  The most explicit allusion to the chaos monster in connection with the exodus is in Isaiah 51:9-10:
"Awake, as in the past, in times of generations long ago. Did you not split Rahab in two, and pierce the dragon through? Did you not dry up (chrb) the sea (ym), the waters of the great deep (thwm), to make the seabed a road for the redeemed to cross?" (Isaiah 51:9-10)
The name Rahab is not attested in extrabiblical non-Jewish sources as the name of the chaos monster. It derives from a Hebrew root meaning "to rage," which is an apt term for denoting the waters of chaos. The creature is also called tnnyn "dragon" and two things happen to it: it is "split in two" or "cut in pieces" (chzb) and "pierced through" (chll). Marduk both halved the carcass of Tiamat and cut it into pieces, and Baal similarly "dismembered" Yamm. Marduk also pierced Tiamat's heart with his arrow. The actions involving Yahweh and Rahab are then equated with what happened to the Sea of Reeds in the exodus tradition. First the sea was "dried up," which recalls again how Athtart begged Baal to "dry up" Yamm. The Hebrew verb chrb "dry up, lay waste, slay, smite" however does not simply denote the drying of water but has martial connotations, and interestingly it evokes the chzb "splitting, cutting into pieces" in the previous verse. Second, the "sea" is also equated with the primeval thwm, evoking again the mythological subtext. There is another passage in Isaiah that employs the verb chrb and evokes the same conflict myth:
"And the waters of the Sea (ym) will ebb (nst), and River (nhr) will be dehydrated (ychrb) and dried up (ybs)." (Isaiah 19:5)
Referring to Egypt, this passage has remarkable parallels to the Ugaritic conflict myth. Yamm and Nahar are mentioned together in a bicolon, and two additional words are used together, nst "scatter, ebb" and ybs "dry up": "Baal grabs Yamm (ym) and sets about dismembering (ysht) him, sets about finishing Judge Nahar (nhr) off. By name Athtar reprimands him, 'Dry him up (ybs), O Mighty Baal, dry him up (ybs)" (KTU 1.2 IV 19-34).  A second reference to Rahab, this time in the Psalms, resembles the allusion in Isaiah 51:
"You control the pride of the sea (ym), when its waves ride high, you calm them; you crushed (dk't) Rahab, as one wounded (kchll), and scattered (pzrt) your enemies with your mighty arm" (Psalm 89:9-10)
There is no direct allusion to the exodus in this passage and the combat myth with Rahab is instead linked with the day-to-day control over the Sea. The verb dk' means "crush, break into pieces" which evokes Marduk's crushing of Tiamat's skull with his mace and his subsequent dismembering of her body, as well as Baal's butchering of Yamm's carcass.  The verb chll "wound, torture, transfix" also occurs in a similar reference to the Yahweh-Rahab battle in Job 26:12-13:
"With his power he calmed the Sea (ym), with his wisdom he struck Rahab down. His breath made the heavens luminous, his hand transfixed (chll) the Fleeing Serpent (nchs brych)." (Job 26:12-13)
This verse is found in a chapter full of motifs that suggest both cosmogony and maintenance of creation, so it is possible (as the Talmud indicates) that the primordial chaos monster is meant here. Job 9:13 also mentions that "Rahab's minions still lie at his feet", alluding to the effects of a past conflict. In Job 26:12, Yahweh is said to "strike down" (mchz) Rahab. This is the same verb that occurs in the Baal Epic, when Kothar tells Baal: "Now your foe, Baal, now your foe may you smite (tmchz), now may you vanquish your enemy" (KTU 1.2 iv 9). In the next verse, Yahweh is said to have chll "transfixed, tortured, writhed" the Fleeing Serpent (nchs brych), the latter expression being a direct borrowing from the Baal Epic.  This can best be seen in Isaiah 27:1, the most famous combat allusion in the OT, which almost verbatim follows the Baal Epic:
Isaiah 27:1: "That day Yahweh, with his hard sword, will punish (ypqd) Leviathan (lwytn) the fleeing serpent (nchs brych), Leviathan the twisting serpent (nchs 'qlltn), he will kill the sea-dragon (tnyn 'sr b-ym)".
KTU 1.5 i 1-4: "When you smite (tmchz) Lotan (ltn) the fleeing serpent (btn brch), finish off the twisting serpent (btn 'qltn), the close-coiling one (slyt) with seven heads, the heavens will wither and go slack like the folds of your tunic".
In both texts we have the patron god (1) smiting/punishing (2) Lotan/Leviathan, specified with the epithets of (3) "fleeing serpent" (4) "twisting serpent" in the same order and utilizing the same words br(y)ch "fleeing" and 'qltn "twisting," followed by (5) a further description of the monster. Lotan and Leviathan are versions of the same name, deriving from the root lwy "to twist" (cf. Arabic laway, Heb. liwya "wreath" in Proverbs 1:9) in a qilat form with a nominalizing -n suffix, with the Hebrew form being more archaic than Ugaritic Lotan. The Ugaritic form, mediated by Phoenician, also appears in Greek mythology as the name of the hundred-headed dragon Ladon, the son of Typhon, who guarded the golden apples in Hesperides' garden (cf. Hesiod, Theogony 333-335; Apollodorus, 2.113, 121; Argonautica, 1490f). It has been suggested that the Greek myth about Hesperides' garden derived from a Phoenician version of the Garden of Eden story, and Leviathan/Lotan was the name of the serpent in the garden associated with the tree of life; the notion of golden apples likewise seems to be related to the motif of the bejeweled trees near Paradise in the Gilgamesh Epic and the similar depiction of Paradise in Ezekiel 28:12-142 and 1 Enoch 18:6-8, 24:2-6. The dragon was slain by Herakles:
According to the Ugaritic myth, Lotan had seven heads and according to another passage, so was Yamm, when Anat declared: "I have smitten El's beloved Yamm, have finished off the great god Nahar, I have bound the dragon's jaws and have destroyed it, I have smitten the twisting serpent, the close-coiled one with seven heads" (KTU 1.3 iii 38-43) The expression "close-coiling one," Ugaritic slyt is related to Hebrew lwt "enwrap, envelop" and the same lwy root as Leviathan/Lotan. The motif of a battle with a seven-headed dragon is a very ancient concept; the Tell Asmar seal from c. 2300 B.C. depicts just such a creature being pierced in battle:
The seven-headed motif also appears in Isaiah 11:15 which depicts a future conquest of Yam and Nahar a la the exodus: "And Yahweh will dry up (chrym, "destroy") the gulf of the Sea of Egypt (ym-mzrym) with the heat of his breath, and stretch out his hand over the River (nhr), and divide it (pkh, "smite it") into seven streams, for men to cross dry-shod to make a pathway for the remnant of his people."  Multiple heads are also mentioned in Psalm 74:12-15:
"Yet, God, my king from the first, author of saving acts throughout the earth, by your power you split (pwrrt) the sea (ym) in two, and smashed (sbr) the heads of monsters (r'sy tnynym) in the waters. You crushed (rzzt) the heads of Leviathan (r'sy lwytn), leaving him for wild animals to eat, you opened the spring, the torrent, you dried up inexhaustible rivers" (Psalm 74:12-15).
Here the lwytn monster is said to have plural r'sy "heads". The reference to "saving acts" likely alludes as well to the exodus, and allusions to opening springs and drying up rivers are probably references to the waters of Meribah and the crossing of the Jordan River. By saying that Leviathan and his heads were left for wild animals to eat, the author also likely alludes to the drowned Egyptian soldiers whose corpses were washed up on the shore of the ym sp.  Leviathan is also famously known from Job as well. In Job 3:8, we read of those who "curse the day (ym), who are prepared to rouse Leviathan (lwytn)". The context makes clear that "day" is meant, but this is an obvious pun on ym "Sea," with unambiguous reference to superstitions about waking Leviathan by cursing the sea. Job 40:25-41:26 provides an extended description of the monster, leaving little doubt that a dragon like Yamm or Lotan is meant:
"Leviathan, can you catch him with a fish-hook or run a line round his tongue?...When roused he grows ferocious, no one can face him in a fight. Who can attack him with impunity? No one beneath all heaven.... Who can unloose the front of his coat or pierce the double armor of his breastplate? Who dare open the gates of his mouth? Terror dwells in those rows of teeth! His back is like rows of shields, sealed with a seal of stone... When he sneezes, light leaps forth, his eyes are like the eyelids of dawn. From his mouth come fiery torches, sparks of fire fly out of it. His nostrils belch smoke like a cauldron boiling on fire... When he stands up, the waves themselves take fright, the billows of the sea retreat... Sword may strike him, but cannot pierce him; no more can spear, javelin or lance... A club strikes him like a reed, he laughs at the whirring javelin... He churns the depths into a seething cauldron, he makes the sea fume like a scent burner.... He looks the haughtiest in the eye; of all the sons of pride he is the king." (Job 40:25-41:26)
Although the word tnnyn "dragon" does not occur in the text, the creature expells smoke and fire and is described in a reptilian fashion with scaley plates across his back and chest. There are several other obvious clues. The passage is entirely fixated on the monster's armored defenses from attack, and pictures such hypothetical attacks as piercing by a sword, spear, javelin, or lance, striking by a club, and so forth. If this is just a natural beast of the wild, why the concerted focus on attacks on this creature? The question is also asked: "Who can attack him with impunity? No one beneath all heaven," implying of course that only a heavenly deity could defeat him. He is thus the king of "all the sons of pride," possibly alluding to the kingship of Yamm before his challenge by Baal. The beast is also pictured as living in the sea and the one who "makes the sea fume" and "churns the depths into a seething cauldron" -- classic chaos motifs attributed to Leviathan. It is Leviathan who roils the sea into producing the violent, cresting surf that threatens land by the shore. And yet, as Yahweh explains in the prologue in 40:6-14, he alone is master of the forces of evil and even Leviathan is under his control.  The remaining allusions to the chaos monsters, drawing on the exodus traditions, metaphorically characterize the political enemies of Israel/Judah as Leviathan or Rahab. In fact, this is intended meaning behind the allusion to Leviathan in Isaiah 27:1, and 30:7 calls defeated Egypt "Rahab who sits still," the picture being that of a dead, vanquished Rahab monster that can no longer roil the seas. Psalm 87:4 simply uses "Rahab" as a synonym for Egypt.
THE CONFLICT MYTH IN DANIEL AND THE REVELATION OF JOHN
In post-exilic apocalyptic literature, the primeval conflict myth was frequently used to depict the manifestation of evil on earth -- especially in the guise of political powers. This draws on the likening of Rahab and Leviathan to Israel's enemies in the sources mentioned above. The second century B.C. apocalypse of Daniel characterizes the kingdoms hostile to Judea as beasts arising from the sea (ym):
"I saw that the four winds of heaven were stirring up the great sea; four great beasts emerged from the sea, each different from the other. The first was like a lion with eagle's wings...The second beast I saw was different, like a bear... After this I looked and saw another beast, like a leopard and with four bird's wings on its flanks and it had four heads and power was given to it.... I saw a fourth beast, fearful, terrifying, very strong; it had great iron teeth, and it ate, crushed and trampled underfoot what remained. It was different from the previous beasts and had ten horns" (Daniel 7:1-7)
We can see right away how this vision is connected with the earlier conflict tradition. The reference of the four winds stirring up the sea comes right out of the Enuma Elish: "Anu formed the produced the four winds. He put them in his [Marduk's] hand, 'Let my son play!' He fashioned dust and made a storm bear up, he caused a wave and it roiled Tiamat, Tiamat was roiled, churning day and night" (COS, 1.111 I 105-109). The monsters emerge from the sea just like the primordial chaos monsters, but none of them are serpentine; instead they draw on the griffin-like demons and karibu from Babylonian religion. There is however a dragon conflict myth in the Greek version of Daniel, tho reduced to a rather prosaic encounter between Daniel and a mythical "big dragon in Babylon that was worshipped" which Daniel killed with the king's permission (Daniel 14:23-30). As for the four beasts, Daniel 7:15-27 interprets them as referring to four kingdoms -- the latter representing the Hellenistic empire of Alexander and his successors (i.e. ten kings of the Seleucid dynasty). This is the kingdom that spawned the horrific persecution of Antiochus IV Epiphanes (175-163 B.C.), and like the traditional chaos monsters of old (i.e. Yamm, Rahab, Leviathan, representing the nations of Egypt, Babylon, etc.), the conflict between this oppressive foreign power and the "holy ones" of Judea was seen by the prophet as a battle for supremacy which the "beast" will lose:
"The fourth beast is to be a fourth kingdom on earth, different from all other kingdoms. It will devour the whole earth, trample it underfoot and crush it. As for the ten horns: from this kingdom will arise ten kings (i.e. the Seleucid kings), and another after them; this one (i.e. Antiochus Epiphanes) will be different from the previous ones and will bring down three kings; he is going to speak words against the Most High, and harrass the saints of the Most High. He will consider changing seasons and the Law, and the saints will be put into his power for a time, two times, and half a time. But a court will be held and his power will be stripped from him, consumed, and utterly destroyed. And sovereignty and kingship, and the splendors of all the kingdoms under heaven will be given to the people of the saints of the Most High" (Daniel 7:23-27).
Here we have the conflict myth in a rather muted form, but all the elements are still here. Yamm oppresses the other gods in the Baal Epic, demanding exclusive obeisance (cf. KTU 2.1 i 11-19), just as the Beast appears in Daniel. Yamm even speaks words against El and Baal in the ultimatum sent by his messengers. Moreover the description of the Beast devouring the earth, trampling it, changing seasons, and especially changing the Law evokes the threat of chaos posed by monsters such as Yamm. In the cosmogonic versions of the conflict myth, natural laws, seasons, and boundaries were set to restrain chaos; here the Beast deigns to undo Laws and seasons. Then the conflict, which is fundamentally about "sovereignty and kingship" just as it is in the Baal Epic, is resolved by having the Beast stripped of power, consumed and "utterly destroyed".
But who is it that does the fighting? The oracle only vaguely refers to the saints (i.e. "holy ones") as gaining kingship -- not necessarily stating that they themselves were the ones who destroyed the Beast. But earlier in the chapter, we learn of "one like a son of man ... on whom was conferred sovereignty, glory, and kingship" (7:13-14). The surrounding context is rich in motifs drawn from Canaanite myth and help to identify who this "one like a son of man" is. First we have a description of the "Ancient of Days" on his throne with a divine council on other "thrones" (plural) in his presence holding "court". Mark Smith points out that this passage draws on traditional El imagery (especially in characterizing the deity as of great age) and the picture of El presiding over the divine council is one found in the Baal Epic (cf. KTU 1.2 i 20-40) and Psalm 89:5-10 which says that "El is dreaded in the council of the holy ones". It seems pretty clear, then, that the figure of the "Ancient of Days" is based on El. Immediately after viewing the divine council, Daniel states that "the beast was killed, and its body destroyed and committed to the flames" (7:11). Who killed it? Daniel next sees the "one like a son of man" arriving, and the traditional mythological background of this figure is revealed by the manner of his arrival: "coming on the clouds of heaven" (7:13). This is classic Baal imagery, whose frequent epithet was "Cloud Rider" (rkb 'rpt) in the Baal Cycle (cf. KTU 1.2 IV 8). This title is applied to Yahweh (in the slightly modified form rkwb b'rbt) in Deuteronomy 33:26; Psalm 68:4, 104:3; for example:
"Sing to Yahweh, play music to his name, build a road for the Rider of the Clouds, rejoice in Yahweh, exult at his coming." (Psalm 68:3-4)
But in Daniel, which is a thoroughly monotheistic work, the Ancient of Days is equated with God and the "one like a son of man" is presented as someone seperate from him and also subject to him. This preserves the traditional contrast between El, the father god and head of the pantheon, and Baal who rules as king but who is subject to Father El. As mentioned at the beginning of this post, Yahweh ceased to function as the patron deity for Judah when he became the transcendant One God in post-exilic Judaism. The various patron deities worshipped by the other nations could not longer be accepted in a polytheistic sense as literal gods and thus they were instead construed as angels and archangels allotted to the nations. Thus in Daniel 10:13 we read of a conflict between the "prince of the kingdom of Persia" and the angel Michael who represents the Jewish people as their "leading prince", and 10:20 later refers to the "prince of Greece". These angelic princes are among the supernatural Powers and Principalities alluded in sub-Pauline literature (Colossians 1:15-16, 2:14-15; Ephesians 1:20-21; 1 Peter 3:21-22).
Christian tradition would identify the Messianic Baal-figure with Jesus who would conquer and defeat the powers of evil on the cross (the Passion being the event that "condemns the prince of this world" according to John 16:11), die and rise again, ride the clouds to judge the earth, and assume kingly dominion over the earth while being subject to God the Father. But within Daniel, the enigmatic "son of man" figure is not outright identified but Daniel 12:1 implies that Michael, the "great prince who mounts guard over your people," will be the one to "stand up" and deliver the Jewish people from evil. Such a role can be found for Michael in the War Scroll (first century B.C.), who is appointed to combat and subdue the "prince of the realm of wickedness":
"You appointed the Prince of Light from of old to assist us, for in his lot are all the sons of righteousness and all sprits of truth are in his dominion....Today is God's appointed time to subdue and to humiliate the prince of the realm of wickedness. He will send eternal support to the company of his redeemed by the power of his majestic angel of the authority of Michael. By eternal light he shall joyfully light up the covenant of Israel -- peace and blessing for the lot of God -- to exalt the authority of Michael among the gods and dominion of Israel among all flesh. (War Scroll, 1QM 13:10; 17:5-8)
It is with the foregoing firmly in mind that we now consider Revelation. This is a work which shows heavy influence from Daniel but which has separate access to the traditional conflict myth. Endorsing the view that Jesus, and not Michael, constituted the promised Messiah, Revelation 12 presents Michael as the protector of the Messiah from the forces of evil. Revelation 12:1-2 first describes a heavenly woman giving birth to the Messiah, who is described in astral imagery. Although no clear analogue can be found in Canaanite mythology, the implied relation of the woman to Eve suggests a possible connection with Asherah, the mother goddess (whose epithet is "Lady who tramples Yamm"). There may also be a link to the Ugaritic myth of the birth of Shahar and Shalem, the beautiful sons of Asherah (KTU 1.23). In Revelation, Jesus is the Messiah-figure whose birth is depicted in ch. 12 and he is given the epithet "morning star" twice in the book (cf. 2:28; 22:16). In the Canaanite myth, Shahar is the god of dawn and appears as the morning star, and later must retreat to live in the wilderness for seven years. Similarly, the woman and her Messianic child (e.g. the morning star) must also flee to the wilderness and hide there for three and a half years (12:6). The woman and child are threatened by a "huge red dragon" that has seven heads (12:3) -- a motif directly borrowed from the myth of Leviathan and which goes back at least as far as the third millenium B.C. Tell Asmar seal. Then the combat narrative is related next:
"And now war broke out in heaven, when Michael with his angels attacked the dragon. The dragon found back with his angels, but they were defeated and driven out of heaven. The great dragon, the primeval serpent, known as the Devil or Satan, was hurled down to the earth and his angels were hurled down with him. Then I heard a voice shout from heaven, 'Victory and power and empire forever have been won by our God, and all authority for his Christ, now that the persecutor, who accused our brothers day and night before our God, has been brought down." (Revelation 12:7-10)
This is a transparent survival of the old combat myth, except the primeval serpent is identified with Satan and the details of the combat itself are not related. Here, crucially, we see that Michael fills the role of Baal or Marduk in the divine conflict, a concept that draws on the post-exilic notion of Michael as the patron deity of Judea. Here Michael functions as a divine warrior fighting on behalf of his king, who is being attacked by the one threatened by the Messiah's potential kingship. The conflict is also one that does not begin or end at the borders of Judea but which involves the entire world, as the Devil is viewed as having worldwide authority (cf. 13:2). But while the dragon has been Christianized as Satan the Devil, he is still the same old personification of the Sea we encountered in the OT and in Babylonian and Ugaritic myth:
"The serpent vomited water from his mouth like a river after the woman, to sweep her away in the current, but the earth came to her rescue; it opened its mouth to swallow the river thrown up by the dragon's jaws. Then the dragon was enraged with the woman and went away to make war on the rest of her children, that is, all who obey God's commandments and bear witness for Jesus. And then I was standing on the seashore. Then I saw a beast emerge from the sea, it had seven heads and ten horns, and its heads were marked with blasphemous titles. I saw that the beast was like a leopard, with paws like a bear and a mouth like a lion; the dragon had handed over to it his own power and his throne and his worldwide authority." (Revelation 12:15-13:2)
This passage combines ancient chaos motifs with more recent material from Daniel. Like the classic chaos monsters of old, the dragon vomits torrential water from its mouth which grows into a river and then a sea. The earth opening its mouth might be an allusion to Mot who in the exodus traditions cooperated with Yahweh in defeating the Sea. It also spawns a new beast who also has seven heads but is described in Daniel-like imagery. The seven bowls of plagues poured out by the angels also evokes the OT conflict tradition. There is a bowl for "rivers and water-springs," another for "the sea," another for the "throne of the beast," and another for "the great river Euphrates" which caused "all the water to dry up" (Revelation 16:3-12). Then ch. 17 refers to "the famous prostitute who rules enthroned beside abundant waters," and while the allusion is obviously to Babylon and Jeremiah 51:13, the wording still closely evokes the palace of El and Asherah at the source of the two rivers and the double-deeps. Then we encounter another conflict between an angel and the dragon where the latter is overpowered and chained up for a thousand years in the abyss (20:1-3), before finally being consigned to the lake of fire. The final relevant text is 21:1 which presents an eschatological future where "there is no longer any Sea". The final defeat of the dragon would naturally enable the creation of a new cosmos which by design eliminated the evil of the Sea for eternity.
Anyway, it's been a long journey from the early primeval legends to modern Christian apocalypse, but this survey shows that concepts promulgated thousands of years ago under very different circumstances and with very different polemical intent may still linger on in various forms today.