I understand that fever is part of your body's effort to make the environment inhospitable to whatever pathogen is infecting it. Are muscle aches just a by-product of the immune response? If so, why do they accompany a fever only some of the time? While we're at it, can someone tell me what causes muscles to ache with fever?

The fever is a reaction coming from chemicals your body releases when encountering a foreign body ( in this case most probably a virus) . These chemicals go into the bloodstream and reach your hypothalamus (in your brain), which react in a rudimentary fashion by increasing your body temperature.

The actual muscle ache part I would like to understand myself. My point is that the two are not necessarily connected.

Muscle aches during illness are usually attributed to dehydration (and sometimes a resulting electrolyte imbalance). Fever can cause this, but so can vomiting and diarrhea, and so can not drinking fluids when you're sick.

Muscle aches during illness are usually attributed to dehydration (and sometimes a resulting electrolyte imbalance). Fever can cause this, but so can vomiting and diarrhea, and so can not drinking fluids when you're sick.

Can you provide a cite for that, Nametag? I've read that dehydration can cause muscle cramping. What I'm talking about is that pervasive "everything hurts" kind of muscle ache. Maybe dehydration can cause it, but in my experience, the onset of the aching coincides with the fever, as does its disappearance.

The medical community attributes most myalgias and arthralgias associated with infection to a variety of immunologic processes induced by the infection. Cytokinins and other chemicals released by the body to fight the invader tend to cause inflammation in muscles and joints, and often muscle enzyme levels are elevated in the blood as a result of this.

Immune complex deposition has also been identified as a probable cause. Antibodies binds to the virus or bacteria, inactivating it and making it more easily digestible to white cells. This process also causes local inflammation and tissue irritation.

Essentially, the 'chemical warfare' that the body's immune system wages on the invader has a lot of collateral damage to the battlefield itself, within the muscles, joints, blood vessels, lungs, etc. Hence the aches and pains as the battle rages.

So is there anything that determines why you get muscle aches sometimes and not others?

Lots of variables and unknowns to that one, but a short answer is that many infections just don't trigger a full blown immune response. Many reasons, lots of them unknown, as to which triggers what. But otherwise every cold would trigger your body's equivalent of WW III.

Which is good, as sometimes it's the immune response to an infection that is fatal, not the infection itself.

I'll note that in various infections, especially those due to viruses, the body produces substances called interferons.

It is instructive to note that when interferons are used therapeutically, i.e. as medicines (for things like viral hepatitis and certain leukemias), many of their side effects are basically just the symptoms of a typical "flu", i.e. aches, myalgias, "malaise", headache, fever, etc.