To those who say their mages cannot hit with spells and are likely new to the Pathfinder ruleset a few tips:
Ranged attack spells like Scorching Ray & many cantrips use Dex for attack rolls in conjunction with your Base Attack Bonus (like hitting in melee with swords uses Strength + BaB) BaB for pure mages is pretty poor, however this is mitigated somewhat by the fact that ranged attack spells affect Touch Armor Class i.e. they don't take into account enemy creatures armor. So if you want to hit more with Ranged Attack Spells and cantrips pump your Dex. You should also be able to take the Weapon Focus Ranged Spells feat. Touch attacks are weak against high dex enemies though, as they will have most AC from their Dex and so your mage will miss more often.
However keep the following in mind:
-Cantrips are extremely poor when it comes to damage. This is why cantrips are unlimited casts. The dazzled condition (from Flare) is also near useless. Daze is good for the first level or two though. Crossbows and the like are always better for pure damage with low level mages; the reason they implemented unlimited cantrips was because players of D&D3e complained about having to use crossbows or slings for their wizards & sorcs They wanted something to make them feel magey.
-Specialist Wizards should get stronger spell like abilities than cantrips, like Evokers should get Arcane Bolt which is much better than any attack cantrip
-Ranged touch spells might seem like a great idea, but most of the iconic spells like Fireball, Lightning Bolt, Magic Missile, Burning Hands (this should be great against swarms btw like those spiders) don't use attack rolls. In fact, most of the best spells don't, so keep that in mind when generating your character. Always prioritize your spellcasting stat; INT for Wizards & Magus; Cha for Sorcs. Con should be second for pure Wizards & Sorcs, then Dex. Magus should focus on Str after Int and not prioritize Dex as they can wear armor and they use their Spellstrike ability to hit with Touch spells in melee so they don't need Dex for it. Magus is also not a good class for a newbie to Pathfinder btw.
-Certain spells work best against certain types of foes. Charm type spells work best against foes with low WILL saves, while offensive spells like fireball and lightning bolt work best against foes with low REFLEX saves.
-Its usually better to go with Wizard over Sorcerer. Its also usually better to specialize as a Wizard.
-Don't multiclass with a pure casting class.
-Get spell focus in the spells you enjoy using most; if you like blasty, pick Spell Focus Evocation and Greater Spell Focus Evocation.
-Get Empower Spell metamagic feat, and Maximize later on. Enlarge could be useful for the first fireball in a fight too. But if you want 1 MM feat its empower.
-Spell Penetration Feat is a must for wizards sorcs, clerics and druids.
-Sleep & Color Spray should be overpowered KING spells for the first 3 levels, helping you end encounters immediately.
-Enlarge person is a shit tier spell and a trap; I like it for the cool factor but for effectiveness it is pure crap. It actually makes your fighters worse in the first few levels rather than better, making them easier to get hit while hardly improving attack bonus and damage. By the time it actually gets better, the improvement in stats is negligible; magic missile will always be a better choice and you should have stuff like Bulls Strength (king of buffs).
-Wizards/Sorcs will get very powerful later on. So will Clerics & Druids. Which is likely why they don't seem to have too many pure caster companions.
-Finally, you really should play this on standard difficulty the first time, i.e. the one using the core ruleset. Using higher difficulties will cause unpredictable spikes, which is why so many are complaining about difficult fights.
-This isn't PoE. You need to plan your character from the get go and stick to that plan. Even if you want a simple greatsword wielding fighter, all your feats and attributes should be planned from level 1, as well as multiclass dips.
-Amri the iconic barbarian should be fantastic as a damage dealer after a couple of levels if they are using her straight from Pathfinder. She will have trouble hitting stuff early because her greatsword is actually a large weapon (its a giants weapon) which gives her penalties to wield from the get go. In the beginning she can only wield it effectively while raging as the bonuses from rage helps mitigate her penalties, and when she does hit her damage should be massive; this is deliberate and she's actually a great and unique character type in the core Pathfinder game/mythos.