There are no special rules about attacking a familiar. It's a separate creature from its master.
A familiar on its master's arm is subject to any area spells that include the master's space. It gets a save of its own (if applicable), and its own evasion ability or SR do apply. Some DMs allow the critter a cover bonus to its save in this instance.
Targeted spells affect only the specified creatures. When such an effect hits the master, the familiar remains unharmed. Of course, the familiar itself could be targeted too, especially for multi-target spells like chain lightning.
A familiar inside a pocket or bag has total cover from area attacks. That means it is unharmed by most area attacks, such as fireballs, unless its container is destroyed by the attack. (Remember that the master's equipment and clothing are always undamaged, unless he dies or rolls a natural 1 on his save.)
The flesh to stone case is interesting, if the familiar is stowed. The spell only affects one creature plus its gear, so the master and all his stuff would turn to stone, but the familiar would not. You might end up with a live familiar trapped inside a stone sack. Unless freed it would probably run out of air very quickly...