Who was St. Joseph's Father? The New Testament seems to give two answers Matthew 1:16 (NASB)


  16 Jacob was the father of Joseph the husband of Mary, by whom Jesus was born, who is called the Messiah.


Luke 3:23 (ESV)


  23 Jesus, when he began his ministry, was about thirty years of age, being the son (as was supposed) of Joseph, the son of Heli,


The problem here is that Matthew names Jacob Jesus's Grandfather and Luke names Heli. What is going one here? A mistake? A misunderstanding of Jewish genealogies?
The books of Matthew, Mark, Luke and John can be seen to present Christ as King, Servant, Man, and God (in that order). See E.W. Bullinger's wonderful book Number in Scriptures for more on this topic (the chapter on the number seven).

As Bullinger puts it, a king must have a genealogy, and a man should have one. You'll notice that Matthew's genealogy starts with Abraham and goes down to Joseph, while Luke's genealogy proceeds up from Joseph to Adam and God. Matthews lineage describes the royal lineage through Solomon, while Luke's lineage describes the natural line through Nathan (Solomon's older brother, the third of four sons to David and Bathsheba - see I Chronicles 3:5). The first (Matthew's) is legal, the latter (Luke's) is natural.

Both lines eventually meet when Joseph, the son of Jacob (Matthew) marries Mary, the daughter of Heli (Luke). Luke 3:23 refers to Joseph as being the son of Heli out of the Jewish legal sanction and customary practice to refer to the son-in-law as son.

To summarize, Matthew's is the genealogy of Joseph, son of Jacob. Luke's is the genealogy of Mary, daughter of Heli.

Source: EW Bullinger's Number in Scriptures