Instructions
Determine why the rat is biting you by monitoring both its actions and your actions. If your rate is nibbling your hands as you approach it, this is a purely inquisitive bite. These bites don't break the skin and should stop once the rat feels comfortable with time. Spend more time with the rat in this case.
Give the rat attention if it continues to bite during playtime. If a rat feels ignored and knows the only way to get the owner to pet it is through a little nip, then it will continue to bite to get you to play with it. Keep your rat entertained through toys or attention to stop these kinds of bites.
Drawing blood is a surefire way to know your rat is feeling distressed. If a rat bites you this hard, then stop whatever you are doing and examine a way to make the rat feel comfortable. If the rat is retreating when you reach into the cage and then it draws blood from a bite, then this action is making it feel uncomfortable. Drawing blood is your rat letting you know it wants to be let go or left alone.
Watch your rat and keep mind of activities where it doesn't feel compelled to bite you. Repeat these activities and reinforce any positive interactions with treats, and your rat will soon drop its habit of biting.
How to Break Your Rat's Habit of Biting
Breaking a rat's habit of biting mostly involves changing the behavior of the owner and not the rat. Rats bite mostly of defense-related instincts -- the classic rat bite is the "lunge and bite," where it jumps out, bites, and retreats out of defense for itself. So, to change your rat's habit of biting, you must learn to make your rat feel comfortable around you. The rat will bite less, if at all, once it feels comfortable and safe around its owner.