The right answer largely depends on your base layout and of course what hulls you have available to you but I can give some general advice.
Best ships to use;
In my opinion the Guardian and Goliath are the best hulls available for base defence as your main defenders, in the case of Goliaths they are loaded with armour and the bonus range will have thuds outrange all weapons with the exception of assault missiles and SFB3 (the assaults only just outrange) and with 7 armour slots you can get a reasonable amount of resistence with the right selection of drac armours. If you dont have goliaths or guardians dont despair, pretty much any ship will be of some benefit to you, obviously high resistence, high fire power and high armour are going to be a big help as is range so even a HH hull will help you if you dont have something better.
Prepping out guards
One of the biggest problems I find with base defenders is when they are easily prepped out, to give one example, a base I hit yesterday had 4 nicely built, heavily armoured and high resistance goliaths and 1 interdictor, enough to make any base tough, especially if you are online controlling your base guard. The problem was that his guard was easily killed off. 2 of his goliaths were positioned just inside his channel making them very easy to kill with specs, even when he was online and running his ships back into his base to try and keep them clear, it took a few goes but both were killed easily with no damage taken on the specs, after this his neighbours began to try and protect him by going into his base (not sure why a 59 that hits level 40s needs to be protected so heavily but thats another subject), regardless of their attempts I went back in after peeking a few of his neighbours and by this stage he was not online controlling his fleets and the next problem with his guard became apparent and then exploited, his remaining dictor and 2 toilets were set to roam and kindly came out to greet me, I simply waited at the entrance for the last minute and went in to kill first the indictor then the next toilet.
By this stage with my hits and the hits of his neighbours protecting him he bubbled and I had one of his neighbouring 65s killing his 3 ship seige B fleet in my channel so I postphoned the attack until I get home tonight but it highlights the importance of ship placement, and the movement setting for your guards, the actual ships he used were great as guards but they dont work dead. I should mention also that given the chance to attack one more time I would have killed the remaining goliath leaving him with no guard in a poorly designed base.
So, how to protect guards;
First of all, you need to keep them safe from specs, often easier said than done but if you are unsure have somebody with specs check them out, keep guards away from your entrance and use a sub arb to surface any attackers subs before they can get there, remember your sub arb also needs to be protected and the right sub can get within hitting range of a sub arb without being detected or surfaced so positioning is very important.
Base design basics
Use a long channel with a lot of turns so the specs cant reach your defending ships, Use missiles or depth charges on at least 1 of your guards and make sure that guard is in range of where your sub arb will detect and or surface their specs. Put your guards behind walls so the subs cant hit them without going around.
Once you are safe from specs you need to protect from sniping, of the goliaths I spoke of above, at least one of them was seige cannon, now seige cannons are great but they have short range and if not positioned correctly can be easily sniped out, his could have been taken out easily without being under fire with a simple SFB3 cut wolf and 2 others at the front as far as I could tell would have been an easy kill as well. To prevent this you should make sure your guards are either very long range, out of range of the longest range weapons or positioned so that any attacker who hits them will be under fire to do so, preferrably keep them out of range.
Remember, if your guard can be easily killed its going to hurt you more than the actual base hit, going back to the base last night even without killing the final goliath or flattening the now much weakened base I would have inflicted somewhere between 10 and 12 hours of repair time for the loss of my corvette flagship.
Once you have established that your guard cant be taken out with specs or sniping you can then look more at what you use, there are a few things here that will influence your decisions, if you use victory mortar you could supplement them by using a guard that has mortar making sure their fire will be concentrated on the same area as your vic morts, if you do have a heavy mortar base your attacker will want to try to run through as fast as he can which is where a relatively low range high damage defender could be used, something like a rocket, ripper or seige cannon ship to make them stop under your mort fire or run into your high damage ship.
Movement of guards;
The next thing to consider is movement, in almost all cases it is best to set your guard to stay put but there are some exceptions, the general rule is, "do not allow your defender enough movement so they can get into range of specs or snipers", have somebody go into your base and sit outside and see where your guard goes, if any ships gets into range of a sniper you need to change your movement setting. in some cases though it is best to allow them to move but again, be careful about where you let them go. While on this subject, due to the introduction of some great new mortar weapons you need to avoid allowing your ships to stack up in base.
Counter measure ship;
Again, depending on your set up a countermeasure ship could be a useful addition, i know my base could benefit from one, the best ship I have seen for this would be the triton positioned behind my other guards so it stays just out of range and add countermeasure to increase its effectivenss and range. In my base being right of of the way it would not need as much armour, by the time it could be reached it would be too late but it will cop some splash so i would need to make sure the explosive defence is high on it but that would not be the same for all countermeasure ships.
Dont ever use;
I know a lot of people are going to tell you about the benefit and joys of using drones as base guards, please dont do it, they are way too easy to prep out, like the advice suggests above the drones move towards the attacker and get into their range making them easy to kill, yes, in some cases they will work and in some cases i have seen them do a good job but as soon as you get an attacker who has a slight amount of knowledge he will simply pick them off leaving you guardless and with a huge repair bill. Normally when i hit bases i hit with a reason, usually revenge or a warning to leave my neighbours alone and I plan to cause them maximum disruption to them, for every drone i kill I am adding another 26 minutes to their repair bill and when you consider a hurricane can hold up to 50 drones it can really add up, I saw a base recently with 3 hurricanes, each holding 50 drones, if my maths is correct that is 65 hours of repair time just in the drones and they are an easy kill with the right fleet causing minimal damage.
You need your guards to be well armoured to hold up to an attackers fleet, the best armour for this is drac armour providing resistence to your fleet, use low level drac armour if you need to for weight making sure to make the most of your bonuses
As I said from the start, your base layout will have a huge impact on the type of guard you should use but the best advice is to test your design under a few different circumstances and see how it works
2 more subjects that I dont have time for now; arbs and controlling your base guard