Some creatures are innately resistant to magic, having an extra layer of defense against hostile spells that must be overcome before the spell’s effects can resolve. This extra defense - Spell Resistance - functions much like Armor Class in that it’s a static score that the caster must overcome with a successful Caster Level check (1d20 + Caster Level). A character’s Caster Level is generally their class level in the class relevant to the spell in question, but feats like Spell Penetration and Greater Spell Penetration can also improve your rolls to overcome Spell Resistance.
Should a caster fail to overcome Spell Resistance, the spell simply doesn’t effect the target (although it may still effect other creatures, if it’s an area-of-effect spell). Even should Spell Resistance be overcome, the usual defenses against spells must still be checked, including succeeding at a Ranged Touch Attack or surmounting a target’s Saving Throw(s).