M.P.
Immediately separate them and give them. Tell them biting hurts and they are not to do that. Have them apologize to each other before they can be together. And take away the toy.
I suggest intervening before they reach the biting stage. Separate them when you first notice they are having difficulty. Arrange for times during which they play separately.
How old are they? Are you teaching them how to share and how to manage anger?