The genealogies of Jesus may seem uninteresting (and perhaps even contradictory) at a glance, but they serve an important role in establishing His claim as the promised Messiah (Christ). When considered together, the two genealogies (Matthew 1:1-17; Luke 3:23-28) reveal both His legal and physical descent according to the three Old Testament promises:
In this regard, Matthew's genealogy provides us with Christ's legal descent. The names show us how He fulfills the requirements as the rightful claimant to David's throne. Matthew did not intend to include every person in the lineage, but only those necessary to establish the connection from Abraham to David to Christ, using groups of fourteen names apiece likely to aid in memorization. Jesus, while not Joseph's actual son according to heredity, became the legal heir when Joseph married Mary and thus adopted Him.
On the other hand, Luke's genealogy reveals the physical genealogy of Jesus. The list may be through Mary's side, but because Matthew omits some of the names, Luke's genealogy could be Joseph's from another branch. We cannot be sure which line is used. What we can learn is that from this lineage, the connection follows from Adam to Judah to David to Christ (called the Second Adam by Paul).
The genealogies should be taken together as unified in purpose. That is, when viewed as a whole, they reveal Jesus's legitimate claim to David's throne and right to be the Messiah.
Adapted from the lecture notes of Dr. Doug Bookman, professor of New Testament Exposition at Shepherds Theological Seminary (used by permission).