Here's a quick example:
A 7th level wizard is facing a Mind Flayer and wants to shoot a Magic Missile spell at him.
The Monster Manual says that a Mind Flayer has a Spell Resistance of 25 (this is listed as "Special Qualities: SR 25").
The Player's Handbook says that the Magic Missile spell is subject to spell reistance (this is listed with the spell description: "Spell Resistance: Yes").
So, when the wizard casts the spell, he first rolls a d20+7 (his level). If his result is 25 or higher, the spell takes effect. Otherwise, it does nothing to the mind flayer.
The wizard has to make this check every time he casts an applicable spell at the mind flayer. Note that the feat Spell Penetration would let him add +2 to his roll (so he'd be rolling d20+9) to get through Spell Resistance.