While Joseph and Mary were in Bethlehem, the time came for her to have the baby. She gave birth to her first son. She wrapped him up well and laid him in a box where cattle are fed. She put him there because the guest room was full.
So Joseph left Nazareth, a town in Galilee, and went to the town of Bethlehem in Judea. It was known as the town of David. Joseph went there because he was from the family of David. Joseph registered with Mary because she was engaged to marry him. (She was now pregnant.)
All this happened to make clear the full meaning of what the Lord said through the prophet: "The virgin will be pregnant and will give birth to a son. They will name him Immanuel." (Immanuel means "God with us.")
But after Joseph thought about this, an angel from the Lord came to him in a dream. The angel said, "Joseph, son of David, don't be afraid to accept Mary to be your wife. The baby inside her is from the Holy Spirit.