Exercise boosts your immunity so I do think light workouts can help you get better faster when you are sick (see the article "
Moderate Exercise Boosts Immunity" on About.com). I've definitely had some head colds where I continued to work out throughout the cold and I feel like the colds were milder or I was able to shake them off completely because of my workouts (of course, it's always hard to truly pinpoint causation in this situation--it could be that those colds would have been mild anyway).
The general rule is that if it's all above the neck and you feel up to it, go ahead and work out at a level you feel comfortable with. If the illness has moved down into your chest, you are running a fever, you are nauseous or experiencing digestive problems, you are achy, or you just don't feel like you have the energy for a workout, then you should rest. In any event, I wouldn't do a workout that is harder than what you would do normally; now isn't the time to push yourself. If anything, I would do a lighter workout. The article "
Getting Through an Injury or Illness" on About.com also has some good tips about exercising when sick.
If I feel up to it, I work out. If I'm so tired I can barely motivate myself to get off the couch, then I stay put on the couch.