Certain classes are better against certain other classes.
In general:
Heavy is weak against Spy, Sniper, and Demoman.
Heavy is strong against Scout, Pyro, and Medic.
Heavy is even (more or less) against Soldier.
An Engineer versus Heavy depends entirely on if the Engy has a level 2-3 sentry or not. A mini-sentry or level 1 sentry will almost always see the Heavy win at full health. In this case, the Engineer should flee. If he was building mini-sentries, building them as you flee is an excellent idea, as it will slow the Heavy down to kill it, or make him ignore it to chase you, dealing him damage all the while.
Medic is weak against Scout, Pyro, and Soldier... well, most of the classes in the game, but those three in particular.
Medic is strong against the Spy, simply because a Medic that continually moves will generally outrun or dodge a Spy's backstab.
The thing is... a Scout has the best chance of killing a Medic if he can manage to get behind the Medic, simply because a medic is a 2-shot kill with the standard Scattergun at close range.
Now, the best defense against a Heavy/Medic pair is to work with your own teammates. If you can take out one of the two, the other teammates may be able to take out the other.
If you really do need to combat them alone, Sniper is likely your best bet. As tempting as it is to go after the Medic first, if he keeps moving, he can generally outrun your scope. However, a fully charged headshot will one-shot the Heavy.
If they Uber, run, unless you're an Engineer trying to keep a sentry nest up. In this case, repair repair repair, and hope that they aren't smart enough to have the Medic block the sentry's knockback effect. If you can get a Pyro to help you by airblasting the Medic or Heavy away, even better.
P.S. NEVER go head-to-head versus a Heavy, he will always likely win simply because of how much damage he does.
Best Answer
From a quick test of mine, this is the max distance for Back Scatter mini-crits:
I put the Soldier under the center of the light and crept closer until the shot was a mini-crit. I don't have the distance numbers, but hopefully this image is descriptive enough. To me it looks like about half Sentry visibility range; if so that's 512 Source units (the point where the distance modifier in the damage formula is 1.0).
And just to confirm, you cannot get mini-crits from the front with it. The "and" in the description means both conditions must be met. (I was confused about this too at first.)