You can cast spells and use magic items while fighting defensively.
Benefit: So long as you are considered armed or are carrying a shield, you can use the fighting defensively option when casting spells or activating a magic item. The benefits are the same as when attacking: −4 to hit and +2 to AC until your next turn. You can also gain the benefits of Combat Expertise while casting or activating.
Normal: You can only fight defensively with an attack or full-attack action.