Your primary strategy has to be to pre-emptively not get caught out of position. As a ranged damage-dealing character, you are fragile and important to your team's success. You are a primary target, and must always be aware of where you are in relation to the enemies. In team fights, always keep an ally or two between you and the enemies. Use hit and run tactics, especially with mages like Heimerdinger and Annie, and retreat while your spells are on cooldown.
Ideally, your allies would also be protecting you. The longer you live, the more damage you're dealing, and the more helpful you are to your team. The tanks and off-tanks should be focused on making sure that you are alive and well, or else they're not doing their job properly either.