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