While Mary was still engaged to Joseph, she miraculously became pregnant through the Holy Spirit, as foretold to her by the angel. When Mary told Joseph she was pregnant, he had every right to feel embarrassed.
He knew the child was not his own, and Mary’s clear falseness could bring a serious social shame. Joseph had no right to divorce Mary, because under Jewish law Mary could be put to death by stoning.
Although Joseph’s first reaction was to break their engagement, the right thing for a righteous man of God to do, he treated Mary with extreme kindness. He did not want to cause her further shame to society.
So he decided to act quietly, but God sent an angel to Joseph in a dream to verify Mary’s story and support him that his engagement to Mary was God’s will. The angel explained that the child within Mary was conceived by the Holy Spiritual.
The Angle even said that the child’s name would be Jesus and that he was the Messiah, God with us. When Joseph woke from his dream, he willingly obeyed God and took Mary home to be his wife, in spite of the public humiliation he would face.
Perhaps this noble quality made him God’s choice for the Messiah’s earthly father. During that time, Caesar Augustus had decreed that a census had be taken, and every person in the entire Roman world had to go to his own town to register.
Therefore, Joseph being of the line-age of David, he was supposed to go to Bethlehem to register with Mary. But while in Bethlehem before they reached home in the night, Mary had labor pain.
And since the census was due the hotels was too crowded. So Mary and Joseph went to a nearby kraal and where she gave birth to baby. The baby was named Jesus the son of God just like the Angel had said. She wrapped the baby in cloths and placed him in a manger.
Thereafter, out in the fields, an angel of the Lord appeared to the shepherds who were tending their flocks of sheep by night. The angel said to them that the Savior had been born in this town of David.