Great topic. I've had this problem before too. Likely the snake will not strike you if he won't even strike the rat.
I have a huge tub available for just such a situation. I pull the tub while covering the top and place the whole thing in the larger tub. Then the rat can't jump out (sides too high) while I grab the snake. Once the snake is safe I deal with the excited rat.