Six years ago I was at a coffee shop in Farmville, Virginia reading my Bible, when another gentleman came up to me and asked me, “Excuse me, what are you reading?” “Well, I’m reading the sermon on the mount at the moment. How are you doing?” I replied. From that point we began to talk about the nature of the New Testament and he asked me, “Well, how do you reconcile the differences between Luke’s genealogy and Matthew’s genealogy?” Stunned, because I had never been asked that question, I said, “I’m not sure.” The gentleman replied, “Well if you aren’t sure about that, how can you be sure about the rest?” After asking the question, he grabbed his coffee and left. To this day, many Christians struggle with the different genealogies in the Gospels of Matthew and Luke. Is this a direct contradiction that should cause doubt about the historical reliability of Gospels?
Right at the outset of Matthew’s Gospel, we see the that he starts with Abraham and moves forward selectively grouping Jesus’ genealogy in three groups of fourteen, with David as the fourteenth name, almost certainly because of the numerical value of the consonants in David’s name, which add up to fourteen. (Gematria, was a Hebrew practice of totaling the numbers to which the letter of a word corresponded, used in Matthew 1 to emphasize the role of David in Jesus’s genealogy.) This makes sense in light of Matthew’s goal of showing that Jesus is the prophesied messiah who was to come. One of the requirements, was that the Messiah would be in the royal line of David.
Luke’s genealogy differs from Matthew by starting with Jesus and moves backward. The biggest difference are those who are mentioned in Luke’s list—Heli, Matthat, Levi, Melchi, Jannai, and so on (Luke 3:23-24). So the question become, how do we account for these differences. What if Joseph had two fathers?
There are two reasons the text can be read this way: First, some suggest that Mary had no brothers to carry on her father’s name at her marriage, so Heli (Joseph’s father according to Luke) adopted Joseph as his own son. This would then give Joseph two genealogies—his own genealogy and Mary’s genealogy. Second, this could be the case of levirate marriage. Levirate marriage is described in Deuteronomy 25:5: “If brothers are living together and one of them dies without a son, his widow must not marry outside the family. Her husband’s brother shall take her and marry her and fulfill the duty of a brother-in-law to her.” This law states that the brother of a man who dies should marry his brother's widow. Heli in Luke's gospel and Jacob in Matthews gospel, were brothers or half-brothers. Therefore, when one of them died the other married his brothers widow producing Joseph his offspring. This would leave Joseph with two father—Heli and Jacob—one a natural father and the other a legal father. Admittedly, we simply do not know from the text which one was the legal father an which one was the natural father.
In this case, Heli—Joseph’s father according to Luke’s genealogy—and Jacob—Joseph’s father according to Matthew’s genealogy—were either brothers or half-brothers. When one died, the other married his widow, producing Joseph and his offspring. This would leave Joseph with two fathers—both Heli and Jacob—one a natural father, and the other a legal father. From the text, we can’t tell which one is his natural father and which one is his legal father. The important point is that this could explain why Joseph might have two fathers and therefore two distinct genealogies. In the authors opinion, this seems to be the best explanation of the divergent genealogies.
At any rate, we know that the ancient Jews kept written records and oral traditions about their ancestries in meticulous detail, so it is not difficult to image that Jesus’s genealogy being preserved. It seems difficult to imagine that Matthew and Luke would simply make up names they had never heard, especially when the Old Testament already provided a list of names to adopt (As Matthew did) down through at least the md-fifth century B.C.
Thus, in conclusion, Matthew notes the royal line of Jesus while Luke addresses the legal descendance of Jesus. Given levirate marriage, the divergence in the lists in Luke and Matthew can be explained. There is no contradiction which undercuts the Christian faith.
 W.D. Davies and Dale C. Allison Jr., A Critical and Exegetical Commentary on the Gospel According to Saint Matthew, vol.1 (Edinburgh: T&T Clark, 1988), pg. 163-165.
 Craig Blomberg. The Historical Reliability of the New Testament. (Nashville: B&H Books) 59.