The Birth of Jesus:
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 disgraced. He knew the child was not his own, and Mary's apparent unfaithfulness carried a grave social stigma. Joseph not only had the right to divorce Mary, under Jewish law she could be put to death by stoning.
Although Joseph's initial reaction was to break the engagement, the appropriate thing for a righteous man to do, he treated Mary with extreme kindness. He did not want to cause her further shame, so he decided to act quietly. But God sent an angel to Joseph in a dream to verify Mary's story and reassure him that his marriage to her was God's will. The angel explained that the child within Mary was conceived by the Holy Spirit, that his 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 is one of the reasons God chose him to be the Messiah's earthly father.