I realize, first hand, that the issue of sickness is always a difficult one to deal with. The key is remembering that God's ways are higher than our ways (Isaiah 55:9). When we are suffering with a sickness, disease, or injury, we usually focus solely on our own suffering. In the midst of a trial of sickness, it is very difficult to focus on what good God might bring about as a result. Romans 8:28 reminds us that God can bring about good from any situation. Many people look back on times of sickness as times when they grew closer to God, learned to trust Him more, and/or learned how to truly value life. This is the perspective God has because He is sovereign and knows the end result.
This does not mean sickness is always from God, or that God always inflicts us with sickness to teach us a spiritual lesson. In a world tainted by sin, sickness, disease, and death will always be with us. We are fallen beings, with physical bodies prone to disease and illness. Some sickness is simply a result of the natural course of things in this world. Sickness can also be the result of a demonic attack. The Bible describes several instances when physical suffering was caused by Satan and his demons (Matthew 17:15-18; Luke 13:10-16). So, some sickness is not from God, but from Satan. Even in these instances, God is still in control. God sometimes allows sin and/or Satan to cause physical suffering. Even when sickness is not directly from God, He will still use it according to His perfect will.
It is undeniable, though, that God sometimes intentionally allows, or even causes sickness to accomplish His sovereign purposes. While sickness is not directly addressed in the passage, Hebrews 12:5-11 describes God disciplining us to "produce a harvest of righteousness" (verse 11). Sickness can be a means of God's loving discipline. It is difficult for us to comprehend why God would work in this manner. But, believing in the sovereignty of God, there is no other option than suffering being something God allows and/or causes.
The clearest example of this in Scripture is found is Psalm 119. Notice the progression through verses 67, 71, and 75 - "Before I was afflicted I went astray, but now I obey your word...It was good for me to be afflicted so that I might learn your decrees...I know, O LORD, that your laws are righteous, and in faithfulness you have afflicted me." The author of Psalm 119 was looking at suffering from God's perspective. It was good for him to be afflicted. It was faithfulness that caused God to afflict him. The result of the affliction was so that he could learn God's decrees and obey His Word.
Again, sickness and suffering is never an easy thing to deal with. One thing is for sure, sickness should not cause us to lose faith in God. God is good, even when we are suffering. Even the ultimate of suffering—death—is an act of God's goodness. It is hard to imagine that anyone who is in Heaven as a result of sickness or suffering regrets what they went through in this life.
One final note—when people are suffering, it is our responsibility to minister to them, care for them, pray for them, and comfort them. When a person is suffering, it is not always appropriate to emphasize that God will bring good out of the suffering. Yes, that is the truth. However, in the midst of suffering, it is not always the best time to share that truth. Suffering people need our love and encouragement, not necessarily a reminder of sound biblical theology.