Sexing your Baby RatRats can be really tricky to sex at birth as their genitals look pretty similar at such a young age, but it gets alot easier to tell them apart as they mature.
As the general rule,
the distance between the anus and genitals is always greatest in the males. This is most noticeable in larger litters using a simple comparison method.
Another method used is looking for nipples. The females have them, the males don't. Nipples can often be seen in does as young as 7 days old and they become alot more noticeable as the fur grows in. If you are having trouble finding any nipples then wet the underside of the rat as this makes them more visible.
Using the two above methods will give you the most accurate sexing. If you have not accurately sexed your rats before they are five weeks old then you must get an experienced rat person or your vet to do it for you, as baby rats MUST be separated at five weeks on the dot to prevent any pregnancies.
At two weeks of age the males testicles have still not dropped, sexing the babies can still be tricky at this point.

This is a buck pictured at two weeks of age

This is a doe pictured at two weeks of age
At approx 3 weeks of age the males testicles will 'drop' and it is now that they are most easily distinguished from the females. (Note: they are not fertile until they reach 5 weeks of age, and still need to be with mom at this young age.) Also you must also be aware that young males have the ability to withdraw their testicles up inside of them when they are scared, so double check everyone!

This is a buck pictured at three weeks of age

This is a doe pictured at three weeks of age

This is a buck pictured at five weeks of age (thanks to lilspaz68 for the photo)

This is a doe pictured at five weeks of age (thanks to lilspaz68 for the photo)
Once your rat reaches adulthood, the males and females are easy to tell apart.
Not only do the males tend to be a lot bigger than the does but they have very large visible testicles.
There is the option of neutering your male rat, and they are still usually left with some visible scrotum.

Neutering your male could have advantages such as, calming an aggressive buck, decreasing the amount of marking, providing an infertile cage mate for a picky female, eliminating the amount of body oil and smell produced and even increased expected lifespan (Although note that regular exercise, restricted food intake and regular breeding has been linked to prolonging the males expected lifespan the most.)
Disadvantages include increased likely hood of obesity, cost and risks from surgery and recovery.Spaying your female can help prevent up to 80% of mammary tumors if she is spayed early enough, it also will prevent any pregnancies (you could house her with males for a more balanced colony.) and it is linked to extending her expected lifespan.
Disadvantages are that the surgery has its risks - don't forget its more invasive than a males neuter so its more costly and a longer recovery process.