Although I keep getting stomped in 9 AI on unfair huge(multi) games because the AI team up on me if I do this (or just because they do), I find that the best defensive strategy is to:
a) Take only as many planets as you can afford to improve.
Take planets towards a computer whose color you think is ugly.
c) Continue taking planets until your empire touches his.
d) Scuttle factories far from his empire, and build factories closer.
e) Build repair bays and wait for the AI's inevitable attack.
f) Replace losses as you lose them in battle. Keep your fleets healthy.
g) Make sure to have at least 4 seige frigates. This will delay reinforcements. Tie them to a control group and try to keep them alive (they are pricey.) send an LRM or two along with them if you can afford to. This will prevent him from sending one or two light frigates as a cheap way to get rid of them. Also, a flak frigate makes a good escort to mitigate hangar defense.
h) If the computer bull-rushes, send that planet bombing group. Try to give them an escape if the fleet turns back. If you see the fleet retreating, retreat seige at the same time. (good. pick off one or two of his less armored ships as they run)
i) If you really pounded the computer, send some of your forces to take the planet. If his fleet is injured, he might just let you have it and try to expand elsewhere. You hurt his economy, and you set up your next staging area.
The only problem with this strategy is that you cannot help allies, which I have never found a reasonable way to do regardless.
Make sure you have a well balanced fleet. Military research is important. Light frigates to take out his seige so you do not have to let him slam you while you blast those [you can also send them after the support craft if you see no LRMs. LRMs behind heavy cruisers make a formidable strategy (if he decides to chase your light frigates, run those behind his fleet and use your heavy cruisers on his support craft.)]. Heavy cruisers to go toe to toe with his heavy cruisers, or to help take out his capital ships. (do this first if they are low level and thus easy to take out. after all, they cost the same to replace whether level 1 or level 7.) I do not really understand strike craft, but I figure I am missing out. Build those if you know what to do with them. Personally, I use carriers as a means to level up my cap ships. Heavy cruisers take them out sooo easily, and they are exp. rich.) Finally, do not neglect your support craft. They make the difference, especially if you invested in a Dunov and it reached level 6.