I am convinced that Luke gives the genealogy of Jesus through Mary. Notice how this genealogy begins:
Luke 3:23 And Jesus himself began to be about thirty years of age, being (as was supposed) the son of Joseph, which was the son of Heli,
Two things we need to recognize. First, the Bible usage of the phrase, the son of, is not nearly as strong as the direct word "begat" which is used in the genealogy found in the first chapter of Matthew. One who is the son of someone in the Bible may be a grandson, a descendant of many generations, an adopted son, or a son-in-law. Therefore, Joseph could easily be the son-in-law of Heli and the wording would be accurate. Second, since genealogies were naturally given through the fathers, it would be understandable for Joseph to stand in for his wife Mary when her genealogy was given.
Matthew 1:16 And Jacob begat Joseph the husband of Mary, of whom was born Jesus, who is called Christ.
You can see that the wording of Matthew is much stronger and could not refer to Mary's genealogy. At the end of the line, Jacob begat Joseph. That is a statement which definitely refers to biological birth. This Joseph was the husband of the Mary of whom Jesus was born.
But there are other reasons for accepting the genealogy of Luke as that of Mary. For one thing, the two genealogies are so different that they have to be of different lines. Since they both point to Jesus, one has to be that of Joseph and the other of Mary. As already argued, Luke's has wording that much more readily admits the possibility of being Mary's line. Yet, there is another major point. Consider these passages:
Jeremiah 36:29-30 And thou shalt say to Jehoiakim king of Judah, Thus saith the LORD; Thou hast burned this roll, saying, Why hast thou written therein, saying, The king of Babylon shall certainly come and destroy this land, and shall cause to cease from thence man and beast? Therefore thus saith the LORD of Jehoiakim king of Judah; He shall have none to sit upon the throne of David: and his dead body shall be cast out in the day to the heat, and in the night to the frost.
Jeremiah 22:28-30 Is this man Coniah a despised broken idol? is he a vessel wherein is no pleasure? wherefore are they cast out, he and his seed, and are cast into a land which they know not? O earth, earth, earth, hear the word of the LORD. Thus saith the LORD, Write ye this man childless, a man that shall not prosper in his days: for no man of his seed shall prosper, sitting upon the throne of David, and ruling any more in Judah.
Jehoiakim was the father of Coniah (also called Jeconiah, Jechonias, and Jehoiachin). Coniah did sit for a time on the throne of Jehoiakim, though only for about three months. However, there seems to be a cutting off of the line with these curses from the prophecy of Jeremiah. The descendants of these men will never sit on the throne of David again. However, the genealogical line of Joseph in Matthew (1:11-12) includes Jechonias. Therefore the Messiah, though He must come of the line of David, cannot come through the line of Jehoiakim and Coniah. That is exactly what the New Testament allows with the two genealogies.
The genealogy of Matthew deals with the official line and the legal right of Jesus to be King of the Jews through Joseph His supposed father. This would satisfy the Jewish traditions. However, Luke gives His right to reign in God's eyes through Mary who provides His human nature. This line bypasses the ancient royal lineup entirely and comes through David's son Nathan (Luke 3:31; 2 Samuel 5:14; see Zechariah 12:12 where Nathan's house gets special recognition). In this manner, Jesus was both legally qualified (through Joseph's line) and spiritual qualified (through Mary's line) to be the King of the Jews.