Of the several commentators I have read regarding the genealogical record in Luke, none have positively maintained that this is the line of Mary. To me this is very curious. The reason most have cited for not regarding Mary is that her name is not mentioned. My reply to this is that the previous context demands Mary be seen as the birth mother of Jesus.
Luke, the physician, begins his account by recording the miraculous births of both John the Baptist and Jesus and other relevant prophecy, miracles, the Baptist’s ministry, and a childhood account of Jesus before giving the genealogy of Jesus and tracing it to Adam. So, when Lk. 3.23 states that Jesus “as was supposed” to be the son of Joseph, we know by Luke’s previous statements he is speaking of Mary’s line since she was the physical, genetic link of the God-man who came to provide the substitutionary atonement for humanity’s sin.
We have additional proofs though that verifies that this record in Luke is Mary’s line of descent from her ancestor David. In Rom. 1.3 Paul unequivocally states: “concerning his Son who was born of the seed of David according to the flesh.” Since Jesus was not of the flesh of Joseph who had the line of David through Solomon, the fleshly line came through Mary who traced her ancestry through David’s son Nathan.
Additionally, Luke recorded Acts 13.22-23: “After removing Saul, he made David their king. God testified concerning him: ‘I have found David son of Jesse, a man after my own heart; he will do everything I want him to do.’ “From this man’s descendants [seed] God has brought to Israel the Savior Jesus, as he promised.”(NIV)
Further, the resurrected Jesus Himself has testified that He is of the seed of David: “I, Jesus, have sent my angel to testify to you about these things for the churches. I am the root and the descendant of David, the bright morning star.” (Rev.22.16 NET)