Rats cannot vomit, so are very wary of being force-fed strange substances they can't get rid of: if they do need medicines these should be given by injection or disguised in something really strong-tasting like liver-paté (or peanut butter if you are an American!), unless you are sure the stuff tastes OK.
Because they cannot vomit they do not need to be fasted before a general anaesthetic, and can and should be given water as soon as they come round, to prevent kidney-damage.
Most rats do not have many nerve-endings in their skin, and so are much calmer about injections than are most animals. Probably because of the vigorous way they groom each other, even if you/your vet hurt them giving an injection they won't be traumatized. They just assume you've been rough grooming them: they may give you a nip to teach you better manners, but they won't decide you're trying to murder them the way a dog might.
Note that some big bucks have skin like shoe-leather and are very hard to inject. The normal site for injections is the scruff of the neck, but such leathery bucks may need to be injected in the "skirt" - the fold of skin joining the elbow and knee to the body.
Also note that Baytril, though an effective antibiotic, often causes a small area of necrosis (dead tissue, like a dry ulcer) around the site of the injection - especially if a drop leaks onto the skin.
Rats usually survive anaesthetic very well (though I have known one strain that was allergic to halothane). Internal operations such as hysterectomy may cause post-operative pain, but surface operations to remove e.g. mammary tumours just result in a few hours of mild stiffness.
They do not seem to suffer emotional trauma from being operated on, though I had a rat once who was very upset about being left at the vet's. When she required a second operation, however, she remembered that she would be going home afterwards, and was quite blasé about it.
Unlike mice, rats do not chew each other's incisions, so a rat which has had an operation may safely be put straight back with its cagemates provided they are not too boisterous or bullying. Bear in mind, however, that some vets sterilize the incision with neat alcohol: if your rat comes home smelling like a distillery you will need to keep it away from its cagemates until the smell fades (about six hours), otherwise they may fail to recognize its scent, and attack it as a stranger.
Unless very old, rats heal amazingly fast. Some rats will take their stitches out after an operation, but provided the incision was superficial this doesn't really matter: keep the wound clean and it will heal in a few days anyway. It just means you get a bigger scar.
If a rat has had an internal operation - such as a hysterectomy - it is vital to keep the wound closed. A rat that chews such an incision may have to be put in an Elizabethan collar: if so you must give it soft food such as cooked cereal that it can lap, since rats need to be able to get their hands up to their mouths in order to eat solid food.
Except in very old and run-down animals, post-operative wounds on rats normally granulate in about a day, and heal well-enough for the stitches to be removed after 7-10 days. The wound should be checked regularly for signs of infection. Mild infections can be treated with the same topical dressings as abscesses: more severe infections may need antibiotics from your vet. Also check the stich-holes for inflammation: they often become red and sore if the stitches are left in too long, which is not only uncomfortable for the rat but makes the stitches harder to remove.
A rat who has had a very major operation, or a serious illness, or who is dying, may be too weak to continue living in the communal cage, and require individual nursing. This usually involves setting up a warm, private cage - or letting the rat live free-range provided it's not given to chewing cables etc., or can be kept away from them. Personally I make up a bed for my invalids in a large, open-fronted pine bread-bin, placed on the hearth (but not so near the fire that they overheat) and lined with VetBed (an absorbent, washable fur-fabric available from large pet shops). This keeps the draughts off them and protects them from having things dropped on them, and provides a comfortable base from which to trundle out. If they have to be confined when unsupervized, or kept apart from other rats, I fit a wire grid over the front.
The rat may need special soft food such as baby food, Complan or cooked cereal. It may even have to be fed from a dropper or needle-less syringe - expect to feed three or four times a day, taking 30-40 minutes each time. Rats who are on a soft diet will often need to be bathed regularly, and may need to have their teeth clipped every few weeks.
Depending on how decrepit the rat is, and how long it is ill for, you may need to perform various other services such as cleaning the ears. These can be found in the section on care of the geriatric rat.