Skeptics have criticized the biblical accounts of the ancestry of Jesus. The problem is that Matthew 1:1-17 gives 42 ancestors of Jesus and Luke 3:23-37 has over 50. In addition to that, there are some differences in individuals in the genealogies. How can there be those differences in the genealogies of Christ?
The answer to that question is that Matthew gives the line of Joseph, the legal line. Luke gives the line of Mary, the mother of Jesus. Matthew is a Jewish writer and Jews regarded only the male line of descent. Joseph had to be a descendant of David, or the Jews would not have recognized the genealogy as a fulfillment of the prophecies that Christ would be the Son of David.
Luke was a Gentile writing for Gentiles. He was more particular to give the line that shows that Jesus is indeed the Son of David. So why does Matthew 1:16 say that Jacob was the father of Joseph while Luke 3:23 says that Joseph was the son of Heli? If Mary was the daughter of Heli, especially if an heiress, Joseph, by marriage, would become the “son of Heli.” That there is no contradiction between the two genealogies of Jesus is shown by the fact that the Jews who best understood their genealogies never changed it.
We have said that to take the Bible literally means to look at who wrote it, to whom it was written, why it was written, and how the people it was written to would have understood it. The genealogies of Christ are a classic example of why we must do that.
–John N. Clayton