The "NIV Harmony of the Gospels" by Thomas & Gundry have what I consider an excellent explanation for the differing geneaologies. They offer 4 scenarios, the 4th of which I find the most believable.
From what I remember:
First, Matthew's genealogy begins with Abraham and descends to Jesus and Luke's list beings with Jesus and ascends to Adam. Second, Matthew lists Joseph's genealogy and Luke lists Mary's genealogy. The essay is quite detailed. I typed it up and put the article on the internet 10 years ago. Since then, everyone thinks I wrote it despite my initial references to the original authors. I'm sure the essay is out there somewhere. I'm not going to type it up again!