Joseph's family settled in Goshen, a region in Egypt that was especially fertile and, because of Joseph's planning for the famine, Pharaoh ended up trading the saved grain for the livestock, land, and eventually the people of Egypt.
When Joseph’s father is presented to Pharaoh, it says that Jacob blessed Pharaoh. And again before he leaves, it says he blessed Pharaoh. Wasn't Pharaoh a pagan who demanded worship as if he were himself a god? Why would one of the patriarchs bless him? Shouldn't he have been whacking him on the head with a Bible, or at least with a Torah? (Just kidding, the Torah was written by Moses about 400 years later.)
Several explanations for his kindness and respect come to mind. First, Pharaoh had taken care of Joseph, his beloved son. He'd taken him from the prison to second-in-command and provided for him all these years, so Jacob must have felt tremendous gratitude. Pharaoh also had given them the land of Goshen to settle in, another act of generosity, and they had few other options due to the famine, so it made sense politically to establish a strong relationship with their benefactor.
But I think perhaps the most important reason is one that might be pretty applicable to us today: Just because someone doesn't believe in our God does not mean we shouldn't be kind to them.
In fact, just the opposite.
We should be especially kind and generous. We should be loving and forgiving, as we should also be to other believers, even when they think differently or act in ways that break our hearts. God set the example in Christ that even when we were His enemies, He gave His life for us.
Being kind doesn't mean we have to agree with or join in sinful choices. It doesn't say that Jacob offered sacrifices to the false gods of Pharaoh, but he also didn't start his conversation with, "You’re headed for hell if you don't get rid of that idol!"
If our heart's goal is for unbelievers to know Jesus, our most effective tactic is to show them the love that Jesus showed us. I love what Pastor JD Greear said when he preached from Hosea, "God's love is power, not reward. God's love is the power that liberates us from captivity, not the reward for having liberated ourselves."
We help others discover that power by being a living picture of it, allowing God to transform our lives before their eyes, all the while pointing toward Him rather than accepting credit.