When in doubt.....always check Wikipedia. http://en.wikipedia.org/wiki/Genealogy_of_Jesus
The genealogy of Jesus is described in two passages of the Gospels: Luke 3:23–38 and Matthew 1:1–17. Matthew's genealogy commences with Abraham and then from King David's son Solomon follows the legal line of the kings through Jeconiah, the king whose descendants were cursed, to Joseph, legal father of Jesus. Luke gives a different genealogy going back to Adam, through a minor son of David, Nathan and apparently again to Joseph.
Both gospels state that Jesus was begotten not by Joseph, but by God, being "born", or entering Mary through a virgin birth. These lists are identical between Abraham and David, but they differ radically from that point onward.
There are various theories that seek to explain the different lineages described in Luke and Matthew. Among Christian scholars, its widely believed that Matthew's account follows the lineage of Joseph, while Luke's account follows the lineage of Mary. Both lineages show the direct connection between Jesus and David, which is important because God had told David that a blood descendant would sit on the eternal throne. So, Jesus inherited the legal claim to the throne through his adoptive father Joseph, as explained in Matthew, and Jesus inherited the blood claim to the eternal throne through Mary, as explained in Luke. In this way Jesus manages to be a blood decendant of David (through David's son Nathan) without contradicting a curse God had placed on the family of Solomon, David's eldest son, the legal heir to his fathers legacy of kingship, and an ancestor to Joseph.