That is indeed a very shi*** situation, but just give an honest apology to your friend, she might not except it right away so u should give it some time then. But atleast apologize so u dont regret not doing that. And for the guy, drop him immediatlt. Its fuc*** up what he does and what he says to you. He is so not worth it def not worth it to fu** up a friendship.
I wish you the best of luck!! It sucks fighting over a guy with your friend, been there