Why do bad things happen to good people?

I often wondered why bad things happen to good people, as do many Christians.  While in prayer one day, I asked God this question and I did not get an immediate response.  Days later, I heard that quite still voice ask, "Daughter if bad things never happened in your life would you seek me as often?"  I didn't provide an immediate response.  It wasn't that I was being disrespectful, but I needed to ponder this question for a while.  Even though, some would say that God already knew what was in my heart.  The Bible teaches us that the mouth speaks from the abundance of the heart. After mulling over God's questions, I came to the conclusion that if I had been asked this question about five years ago, the answer would have been "No."  But, now I can honestly say "Yes."  Over the years I have learned to seek God and give reverence whether good things or bad things are happening in my life.   I'm like Paul, whatever state of being I am in, I have learned to be content.  I praise God during the good and bad times.  For me, it's as if the good times are confirmation of my faith and the bad times are a test of my faith.  So, to answer my question, "Why fo bad things happen to good people?"  It's a test of our faith.  Faith is the substance of things hoped for and the evidence of things not seen.  When in the midst of trials and tribulations, I trust that God will bring me through; as this is my faith at work. Faith without works is dead.  I have to speak it and walk in it.  For me, this means, praying daily, meditating on God's word, and encouraging myself through the storm.  I must admit that this is not always easy to do because my flesh rises and wants to succumbs to the voice of the enemy.  However, I rejoice in knowing that by the continuous calling on the name of Jesus, I gain strength to rebuke Satan and endurance to sustain until the end of the bad time or situation.