1) an introductory description of the situation;
2) with very minor variations, the phrase "Behold, an angel of the Lord appeared to Joseph in a dream, saying;"
3) the message of the angel, containing a command with a form of the same Greek verb for "take," and a reason for the command;
4) faith response of obedient execution of the command;
5) a Scripture citation containing a form of the same Greek verb for "call" and a title of Jesus.
These three stereotyped formulas and one of the abbreviated forms all center around Joseph and regard, respectively: 1) taking Mary as wife and naming the child "Jesus;" 2) fleeing to Egypt to rescue the child and his mother; 3) returning from Egypt to Israel with the child and his mother; 4) withdrawing to Galilee and establishing residence in Nazareth. Joseph's cooperation with these divine revelations is in accord with the cited fulfillment of prophecies (the last two dreams being two stages of a single fulfillment) involving the child's titles of "Jesus" (Mt 1:25), "Son [of God]" (Mt 2:15), and "Nazarene" (Mt 2:23). The geographical movement from Bethlehem to Egypt to Nazareth of Galilee is also accomplished in response to dreams (Mt 2:13,20,22) and shown to fulfill prophecies (Mt 2:6,15,23).
Background on Dreams and Angel Appearances
While rare in the New Testament, dreams are rather common in the Old Testament, and a variety of significances accompany them. When foreigners such as Pharaoh or Nebuchadnezzar dream, a Hebrew man of God, such as Joseph or Daniel, is needed to interpret for them (Gen 40:5--41:36; Dan 2:1-49; 4:1-25). Israel, however, needs no help in interpreting dreams, which are often means of divine communication. Yahweh, whom no one can see and still live (Ex 33:20), commonly reveals in dreams and night visions his plans for his people and the role they are to play in those designs, as seen in the examples of Abraham (Gen 15:12-13), Abimelech (Gen 20:3,6), Laban (Gen 31:24), Jacob-Israel (Gen 28:12-13; 46:2-4), Joseph (Gen 37:5-11), Samuel (1 Sam 3:1-14), Nathan (2 Sam 7:4-17), Solomon (1 Kgs 3:5), and Daniel (Dan 2:18-23).
In righteous Joseph's dreams (and not in that of the magi), it is the "angel of the Lord," who appears to him. This exact phrase is found repeatedly and consistently in the Septuagint as a translation for "the angel of Yahweh," who is sent with most important messages to Hagar (Gen 16:7-12), Abraham (Gen 22:11,15), Moses (Ex 3:2), the people of Israel (Jgs 2:1-4), the barren wife of Manoah (Jgs 13:3-5), Elijah (1 Kgs 19:7; 2 Kgs 1:15), and Joshua the high priest (Zec 3:1-10). The types of communications in the dreams cited above and those through the angel of the Lord are most similar, and it is not so surprising that for Joseph these two forms are combined, so that he invariably awakes with total faith and no doubt whatsoever about their interpretation. Gideon has both the appearance of the angel of the Lord addressing him with the title "man of valor," and God speaking to him at night with instructions as to what he is to do (Jgs 6:11-12,25). Balaam has the Lord come to him at night, and the angel of the Lord standing before him in the day (Num 22:20,31-32). The angel of God comes to Jacob in a dream (Gen 31:10-11), and Zechariah speaks with an angel in the night (Zec 1:7-9).
Matthew has shown how Joseph received the vocation to be a key personage in Jesus' infancy, and how that role can only be fulfilled by a special charism, a charism which was communicated to him by an angel of the Lord in dreams, in the way that God communicated to his patriarchs and prophets in the Old Testament. Joseph receives an initial revelation about the identity of the child Jesus, conceived of the Holy Spirit to save his people from their sins. He then receives subsequent messages about how he is to cooperate in that work of salvation by guarding and protecting the child and his mother. In the New Testament, this role and this manner of divine communication are unique to Joseph, so that he alone can be called a "man of dreams," a title previously given to his namesake, the patriarch Joseph (Gen 37:19).
Parallels with the Patriarch Joseph
Of all the Old Testament recipients of dreams mentioned here, probably none is more important than the patriarch Joseph. He not only interprets the dreams of Pharaoh and his court, but first of all is himself the recipient of divine communications in dreams, regarding his role in the history of the chosen people (Gen 37-50). Though Matthew's infancy narrative also contains other resonances and is by no means a systematic allusion to Genesis, there are many significant parallels between the two Josephs, which it will be well to catalog and examine:
1) Name. The name of New Testament Joseph could not help but recall that of Old Testament Joseph, so often repeated in the history of salvation, occurring almost 200 times in the Old Testament and at least eight times in the New. The name is built on the name of God, and means "Yahweh increases" or "Yahweh adds." It is given by Rachel at Joseph's birth in grateful appreciation that the Lord had "opened her womb," with the explanation that it means that God has added another son (Gen 30:22-24). Applied to New Testament Joseph then, it would mean: "God grants him descendence."
2) Name of Father. As already noted, Matthew differs from Luke by listing Joseph's father as "Jacob" (Mt 1:16), a name used for no one else in Scripture except the father of the patriarch Joseph.
3) Mention of name "Rachel." The name of the mother of New Testament Joseph is not given, but the citation in Matthew 2:18 mentions Rachel, the mother of the patriarch.
4) Dreams. In each Testament the respective Joseph is the person most known for dreams. The patriarch also has dreams revealing his future role (Gen 37:5-9 realized in Gen 42:6-9 when his brothers come to Egypt and bow before him). He becomes famous also for interpreting God's message in other people's dreams (Gen 41:12,16,25). Both Josephs are able to understand correctly God's communications in dreams.
5) Threats of Death. In Genesis Joseph's brothers want to kill him (Gen 37:18-20), while in Matthew Herod wants to kill the child entrusted to Joseph's care (Mt 2:13,16).
6) Egypt. The flight of New Testament Joseph into Egypt immediately recalls Old Testament Joseph's being saved from the pit and taken into Egypt where he lived long and prospered (Gen 37:28; 45:9; Acts 7:9), protected from the famine that would later afflict his homeland. In each Testament, a Joseph is the person most associated with Egypt.
7) Involvement with King. New Testament Joseph's stay in Egypt is determined by the hatred king Herod nourishes until his death. Old Testament Joseph's stay in Egypt becomes important because he wins the trust of the pharaoh who puts him in charge of his affairs (Gen 41:41). New Testament Joseph's return from Egypt is occasioned by the death of king Herod (Mt 2:19), while the great Exodus event in the time of Moses begins when there arises "a new king over Egypt, who did not know Joseph" (Ex 1:8; Acts 7:18). Joseph had predicted the exodus, and Moses carried his bones along with him (Gen 50:24-25; Ex 13:18-19; Heb 11:22). "Egypt was glad when they departed" (Ps 15:38).
8) Virtuous and Chaste. In Genesis Joseph resists repeated attempts of Potiphar's wife to seduce him and he suffers unjust imprisonment for it (Gen 39). In Matthew Joseph is a just or upright man and he has no carnal knowledge of Mary.
9) Given Responsibility. Old Testament Joseph becomes overseer of officer Potiphar's house in charge of all that he has (Gen 39:4), keeper of the prison with all the prisoners under his care (Gen 39:22), and finally lord of pharaoh's house and all the land of Egypt (Gen 41:41-45; Ps 105:21). New Testament Joseph is responsible for Jesus and Mary in Bethlehem, Egypt, and Nazareth.
10) Favored and Fruitful. God favors the patriarch Joseph and makes him prosper (Gen 39:3,21,23). He becomes a "fruitful bough," with "blessings of the breasts and womb," and is called a nazîr, one "set apart" or "consecrated" (Gen 49:22,25,26). The people multiply in the land of Egypt (Ps 105:23-24). Joseph, son of David, is favored with the fulfillment of the promised descendence in Jesus, whom he names as his son, and with the fruitful mother of the Savior for his wife. God's guidance protects him from Herod and Archelaus.
11) Patriarchal. Old Testament Joseph is listed with the greatest patriarchs in the history of Israel, as is summed up in Psalm 105 which names him among the elite group of Abraham, Isaac, Jacob, Moses and Aaron; through them the promise first made to Abraham was fulfilled. New Testament Joseph is almost like another patriarch, the last in the chain, who receives in a dream the final assurance of a son and continued blessing.
Joseph's Patriarchal Role
Matthew has thus presented Joseph as the recipient of a combination of two means of divine communication common in the Old Testament: dreams and appearances of the angel of the Lord. The dreams and appearances are described as multiple, and are related according to a stereotyped pattern repeating the same expressions. Old Testament prophecies are fulfilled by Joseph's obedient cooperation with the messages. The prophecies are related to Jesus' titles, and to his geographical movement during the first years of his life. Matthew's Joseph is presented in a way that parallels his namesake, the patriarch Joseph, especially in his association with dreams and Egypt, but also in escaping threats of death, and in being protected and blessed for his faithful exercise of the responsibility entrusted to him.
Matthew's portrayal thus communicates the multi-leveled truth that Joseph has a patriarchal role to play in connection with the prophetic mission of Christ. As a privileged recipient of multiple, combined forms of divine communications, and as a perfectly obedient man of faith who collaborates with all that is commanded him, he recapitulates the history of salvation of Israel, which has reached its definitive culmination in the child he names, protects and raises. The man of dreams who took the child and his mother to Egypt and back is the last of the patriarchs, who receives revelations about the promised descendence in the style of the Old Testament shared by no one else in the New Testament or thereafter.
Taken from http://www.osjoseph.org/stjoseph/scripture/part1sec5.php