6 And Jesse begot 1aDavid the 2bking. And David begot 3cSolomon of her who had been the 4dwife of Uriah,
63 When David committed murder and adultery, he was rebuked by the prophet Nathan, whom God had sent purposely to condemn him (2 Sam. 12:1-12). When David was condemned, he repented. Psalm 51 is the record of his repentance. He repented and God forgave him (2 Sam. 12:13). Then he begot Solomon (2 Sam. 12:24). Hence, Solomon is the issue of man's transgression and repentance plus God's forgiveness.
The genealogy in Matthew says that David begot Solomon, but the genealogy in Luke says that Nathan was the son of David (Luke 3:31). First Chronicles 3:5 tells us that Nathan and Solomon were two different persons. Luke's record is the genealogy of David's son Nathan, who was Mary's forefather, whereas Matthew's record is the genealogy of David's son Solomon, who was Joseph's forefather. One genealogy is the line of Mary, the line of the wife; the other is the line of Joseph, the line of the husband. Both Mary and Joseph were descendants of David. Under God's sovereignty they were joined together by marriage, so that through Mary, Joseph was indirectly associated with Christ. Christ can be counted as a descendant of David through either Solomon or Nathan. Hence, He has two genealogies.
Strictly, Solomon was not a direct forefather of Christ. His relationship with Christ was indirect, through the marriage of Joseph, his descendant, to Mary, of whom Christ was born (v. 16). The Old Testament did not say that Christ would be Solomon's descendant, but it prophesied repeatedly that Christ would be a descendant of David (2 Sam. 7:13-14; Jer. 23:5). Although Christ was not a direct descendant of Solomon, the Old Testament prophecies concerning Christ as a descendant of David were nevertheless fulfilled.