Attacks are defined in the Magic chapter of the *Pathfinder Roleplaying Game Core Rulebook.* From the bottom of page 208 in my 5th printing PDF:

>All offensive combat actions, even those that don’t damage opponents, are considered attacks. Attempts to channel energy count as attacks if it would harm any creatures in the area. **All spells that opponents resist with saving throws, that deal damage, or that otherwise harm or hamper subjects are attacks.** Spells that summon monsters or other allies are not attacks because the spells themselves don’t harm anyone.

Emphasis mine. All damaging spells are considered attacks, as are all offensive combat actions. So long as the attack is dealing damage, painful stare would trigger on it (though still only once per round, as the stare notes).