Spells and Magic
Any spell with a I, II, III… suffix can be undercast at the lower level version. This means that a spellcaster like a Sorcerer only needs to know the highest level Summon Monster they can possibly cast, but can cast it using a lower level spell slot. So if they know Summon Monster III, they can cast it as Summon Monster II if they want to, without needing to use a lower level slot of known spells.
Free spells gained when going up a level must be Common spells taken from the Core Rulebook. Non core classes (such as a Witch or Inquisitor) whose spells lists aren't in the core rulebook, treat any spells in their original spell lists as Common.
Other spells must be purchased (or obtained via 'adventuring') before they can be learnt. The cost of these spells is higher than normal due to their rarity.
|Other Paizo Source
This doesn't mean that all such spells are available (especially for non-Paizo sources). The DC modifier applies to all checks to identify, decipher and learn spells or that rarity.
The normal base cost of a spell is the level squared times 10. Zero level spells cost 5gp.
Common spells automatically gained when going up a level are gained immediately after a night's rest. It is assumed that you've been studying prior to that.
Wizards and other book learners can learn other spells by spending time studying and researching them.
If you have a copy of a spell in a scroll or a spell book, you must first decipher the spell. This requires either the use of Read Magic (in which case the process is automatic, and takes 1 minute per spell level), or a Spellcraft check at DC 20 + spell's level. This takes 1 hour per spell level (30 minutes for a 0-level spell).
Learning a spell you have a deciphered copy of takes 1 day per spell level, and requires a Spellcraft DC 15 + level of the spell. If you fail, then you must wait until gaining another rank in Spellcraft.
If you don't have a copy of the spell, then you need to research the spell. It takes 1 week per spell level, and the cost is 100gp per level of the spell in materials. You need to make a Spellcraft check equal to 15 + 2 x level of the spell, modified by rarity. If you fail, you lose the money and the time. You can try again, and get a cumulative +1 for each previous attempt at that spell.
Sorcerer's don't usually learn spells from books, and when they gain spells they can select any spell from their core lists. However, less common spells can't be selected without some reference material.
If you have a deciphered copy of a non-Common spell scroll (not a spell book) prior to going up a level, then you may automatically learn that spell when you select your spells when levelling up. The scroll is consumed in this process as you 'consume' the energy and knowledge in the spell during your meditations.
Sorcerers are unable to invent or research non-common spells they haven't come across.
You may also get an option to retrain an existing known spell to a rarer one when retraining. The trainer needs to have the spell you want.
As for Arcane spells, Divine spells can only be selected from the Core Rulebook unless the character has had a chance to study them first. Temples, NPCs or scrolls are possible sources. Temples and NPCs will generally charge for access to these spells.
Once studied, such a spell can be selected normally.
Costs are as for Arcane spells.
If you are a Psychic character (not permitted by default), then spells in Occult Mysteries, as well as any spells on your basic class list, can be used as your free spells when starting and levelling up. Otherwise they count as Uncommon, though a PC Psychic will probably have a source they can go to.
There is a restriction on how good some items can be. Weapons and armour are limited by their type, so bigger weapons and heavier armour are easier to enchant than smaller of lighter items.
Weapons are limited by the maximum damage they do. A weapon can have a maximum enhancement bonus equal to half it's maximum damage (round down), to a limit of +5. This is the base damage of the weapon. So a dagger (d4) is limited to +2, a longsword (d8) to +4. A small dagger (d3) is limited to +1.
Armour is limited to half the armour bonus (rounded up), to a maximum of +5.
If a character is raised from the dead using Raise Dead, Resurrection, or True Resurrection then they will age 2d6 years. The caster of the spell will age half the amount rolled.
This assumes humans. Halflings and Half-elves have a x2 multiplier to the roll, Gnomes and Dwarves x3 and Elves x5. The multiplier applies to the raised and the raiser independently.
This means people are generally unwilling to raise someone unless there's a very good reason.