Joseph ... to son of David.
Matthew 1:1 The book of the generation of Jesus Christ, the son of David, the son of Abraham. [SUP]2 [/SUP]Abraham begat Isaac; and Isaac begat Jacob; and Jacob begat Judas and his brethren;
[SUP]3 [/SUP]And Judas begat Phares and Zara of Thamar; and Phares begat Esrom; and Esrom begat Aram;
[SUP]4 [/SUP]And Aram begat Aminadab; and Aminadab begat Naasson; and Naasson begat Salmon;
[SUP]5 [/SUP]And Salmon begat Booz of Rachab; and Booz begat Obed of Ruth; and Obed begat Jesse;
[SUP]6 [/SUP]And Jesse begat David the king; and David the king begat Solomon of her that had been the wife of Urias;
[SUP]7 [/SUP]And Solomon begat Roboam; and Roboam begat Abia; and Abia begat Asa;
[SUP]8 [/SUP]And Asa begat Josaphat; and Josaphat begat Joram; and Joram begat Ozias;
[SUP]9 [/SUP]And Ozias begat Joatham; and Joatham begat Achaz; and Achaz begat Ezekias;
[SUP]10 [/SUP]And Ezekias begat Manasses; and Manasses begat Amon; and Amon begat Josias;
[SUP]11 [/SUP]And Josias begat Jechonias and his brethren, about the time they were carried away to Babylon:
[SUP]12 [/SUP]And after they were brought to Babylon, Jechonias begat Salathiel; and Salathiel begat Zorobabel;
[SUP]13 [/SUP]And Zorobabel begat Abiud; and Abiud begat Eliakim; and Eliakim begat Azor;
[SUP]14 [/SUP]And Azor begat Sadoc; and Sadoc begat Achim; and Achim begat Eliud;
[SUP]15 [/SUP]And Eliud begat Eleazar; and Eleazar begat Matthan; and Matthan begat Jacob;
[SUP]16 [/SUP]And Jacob begat Joseph the husband of Mary, of whom was born Jesus, who is called Christ.
[SUP]17 [/SUP]So all the generations from Abraham to David are fourteen generations; and from David until the carrying away into Babylon are fourteen generations; and from the carrying away into Babylon unto Christ are fourteen generations.
Women are not considered a head in a household and so Joseph as a son in law assumes that head in tracing back Mary;s connection to David... it goes further back but we shall stop at David.
Luke 3:[SUP]23 [/SUP]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,
[SUP]24 [/SUP]Which was the son of Matthat, which was the son of Levi, which was the son of Melchi, which was the son of Janna, which was the son of Joseph,
[SUP]25 [/SUP]Which was the son of Mattathias, which was the son of Amos, which was the son of Naum, which was the son of Esli, which was the son of Nagge,
[SUP]26 [/SUP]Which was the son of Maath, which was the son of Mattathias, which was the son of Semei, which was the son of Joseph, which was the son of Juda,
[SUP]27 [/SUP]Which was the son of Joanna, which was the son of Rhesa, which was the son of Zorobabel, which was the son of Salathiel, which was the son of Neri,
[SUP]28 [/SUP]Which was the son of Melchi, which was the son of Addi, which was the son of Cosam, which was the son of Elmodam, which was the son of Er,
[SUP]29 [/SUP]Which was the son of Jose, which was the son of Eliezer, which was the son of Jorim, which was the son of Matthat, which was the son of Levi,
[SUP]30 [/SUP]Which was the son of Simeon, which was the son of Juda, which was the son of Joseph, which was the son of Jonan, which was the son of Eliakim,
[SUP]31 [/SUP]Which was the son of Melea, which was the son of Menan, which was the son of Mattatha, which was the son of Nathan, which was the son of David,......
Luke was a physician and in dealing with women that give births, he would traced the family lineage of Mary's by way of Joseph as the son in law and thus head of the household to David whereas Matthew the tax collector would directly stick with the head of the household in tracing Joseph's lienage back to David as the men are the ones that pay taxes as head of the family.