| Ravingdork |
Ray spells and melee or ranged touch spells always require attack rolls (though harmless touch spells, such as cure light wounds, don't when used on an ally).
A spell also requires an attack roll when it says it does.
Many spells require a modified CMB check, often substituting the caster's casting stat ability modifier and caster level for other variables, though it like all CMB checks is still considered an attack roll.
It is true that most spells do not require attack rolls at all. Cover works against spells just as it does attacks. If there is an attack roll involved (such as scorching ray) the target gets a +4 cover bonus to AC. If there is no attack roll (such as magic missile) than the target does not benefit from cover (unless it is total cover, which prevents him from being targeted at all).
Many area spells (such as cone of cold) are affected by cover as well, even though they don't have attack rolls. When a target has cover against an appropriate area spell (as determined by the spell's point of origin [which is often the center of the spell effect for most spells]) they might get a +2 bonus on their Reflex saves against the spell due to the intervening barrier. Keep in mind the difference between burst spells (such as cone of cold) and spread spells (such as fireball), as they interact differently where cover is concerned. The latter wraps around cover, negating any cover bonuses that might be had.
Here are the relevant game rules for cover, spell range and spell targeting (for attack roll rules), as well as for bursts and spread area spells for your reference.