If we look at two passages in Matthew and Luke, the answer is that the Holy Spirit made this happen.
First, Matthew 1:18-25 gives a complete narrative of the events of Mary’s pregnancy (with my own emphasis added):
18 This is how the birth of Jesus the Messiah came about: His mother Mary was pledged to be married to Joseph, but before they came together, she was found to be pregnant through the Holy Spirit. 19 Because Joseph her husband was faithful to the law, and yet did not want to expose her to public disgrace, he had in mind to divorce her quietly.
Obviously, Joseph was suspicious of Mary’s pregnancy, too. After all, he knew where children came from just as much as everyone else. Keep in mind, also, that during this time of Jewish history, when a man and a woman were “pledged to be married,” this is a even bigger deal than a couple being engaged, so a “divorce” would be needed to call off the marriage. Also, the terms “husband” and “wife” are still used, even though they aren’t technically married yet (Joel 1:8 is another example of this terminology: “Mourn like a virgin in sackcloth, grieving for her husband of her youth.”).
Continuing in verse 20...
20 But after he had considered this, an angel of the Lord appeared to him in a dream and said, “Joseph son of David, do not be afraid to take Mary home as your wife, because what is conceived in her is from the Holy Spirit. 21 She will give birth to a son, and you are to give him the name Jesus, because he will save his people from their sins.” 22 All this took place to fulfill what the Lord had said through the prophet: 23 “The virgin will conceive and give birth to a son, and they will call him Immanuel” (which means “God with us”).
This is the second usage of the Holy Spirit playing into Mary’s pregnancy; that is, Mary never had relations with anyone, including her husband Joseph, to be pregnant. The Holy Spirit placed the child inside her. Verse 23 also enunciates the fact that she is a virgin when she conceives a child.
Verses 24 and 25 close this out...
24 When Joseph woke up, he did what the angel of the Lord had commanded him and took Mary home as his wife. 25 But he did not consummate their marriage until she gave birth to a son. And he gave him the name Jesus.
Again, Joseph was not involved in the conception of Jesus; it was the Holy Spirit’s doing. In fact, they never had relations before Jesus’ birth, eliminating him as the birth father.
Luke 1:28-37 is another account of Mary’s pregnancy:
28 The angel went to her and said, “Greetings, you who are highly favored! The Lord is with you.” 29 Mary was greatly troubled at his words and wondered what kind of greeting this might be. 30 But the angel said to her, “Do not be afraid, Mary; you have found favor with God. 31 You will conceive and give birth to a son, and you are to call him Jesus. 32 He will be great and will be called the Son of the Most High. The Lord God will give him the throne of his father David, 33 and he will reign over Jacob’s descendants forever; his kingdom will never end.”
The angel tells Mary flat-out that she will be pregnant with Jesus. And as seen in verse 34...
34 “How will this be,” Mary asked the angel, “since I am a virgin?”
...she’s understandably confused because she’s never had relations with a man. Verse 35 clears it up....
35 The angel answered, “The Holy Spirit will come on you, and the power of the Most High will overshadow you. So the holy one to be born will be calledthe Son of God.
It seems like a simple answer to say that the Holy Spirit impregnated Mary, and it could seem like it’s a thoughtless answer to just say God did it. But the Angel understands the doubt in verse 36:
36 Even Elizabeth your relative is going to have a child in her old age, and she who was said to be unable to conceive is in her sixth month. 37 For no word from God will ever fail.”
Concluding, it’s the Holy Spirit who made Mary conceive with the Christ, as only God could cause such a thing without Mary needing relations with a man.
-Roger Gelwicks