The Gospel passage we have just heard broadens our view. It presents the history of Israel from Abraham onwards as a pilgrimage, which, with its ups and downs, its paths and detours, leads us finally to Christ. The genealogy with its light and dark figures, its successes and failures, shows us that God can write straight even on the crooked lines of our history.

God allows us our freedom, and yet in our failures he can always find new paths for his love. God does not fail. Hence this genealogy is a guarantee of God’s faithfulness; a guarantee that God does not allow us to fall, and an invitation to direct our lives ever anew towards him, to walk ever anew towards Jesus Christ.

(Benedict XVI, Homily in the Basilica of Mariazell, 8 September 2007)
Full text: http://www.vatican.va/holy_father/benedict_xvi/homilies/2007/documents/hf_ben-xvi_hom_20070908_mariazell_en.html