Unless you are using castings to kill every single rat and goblin, you should have plenty of the most common spells by midgame, though the rarer spells you may get low on if you use them often. In the late game, you generally fight a lot fewer monsters, and each individual one often gives much more experience, so it normally isn't an issue. There are also a few battles in the endgame--cat lord, Chaos Archmage--that can give many levels at once, which can give you a whole pile of extra castings.
FWIW, this is the spell list of the level 50 elementalist that I won with. I have 4000 castings of burning hands, and 7000 of fire/frost bolt, but only 269 of fireball, 155 of lightning ball, 130 of iceball. Apparently this character also found/wished for acid ball spellbooks, which I used pretty heavily.
Code:
Acid Ball : 304, 32pp (Effectivity: +16)
Burning Hands : 4364, 4pp (Effectivity: +31)
Cure Disease : 1305, 8pp (Effectivity: +0)
Darkness : 1377, 4pp (Effectivity: +3)
Earthquake : 205, 80pp (Effectivity: +0)
Fire Bolt : 7079, 6pp (Effectivity: +13)
Fireball : 269, 15pp (Effectivity: +6)
Frost Bolt : 6688, 8pp (Effectivity: +20)
Ice Ball : 130, 25pp (Effectivity: +0) \\Never noticed I learned this
Identify : 389, 75pp (Effectivity: +0)
Improved Fireball: 174, 24pp (Effectivity: +0) \\Never used this
Invisibility : 733, 9pp (Effectivity: +5)
Lightning Ball : 155, 30pp (Effectivity: +0)
Magic Missile : 1168, 6pp (Effectivity: +14)
Scare Monster : 776, 12pp (Effectivity: +0)
Strength of Atlas: 561, 10pp (Effectivity: +0)
Teleportation : 712, 21pp (Effectivity: +7)