I am afraid that the OP's friend is right to worry about a complaint being turned against her - it's a standard tactic against any employee with a complaint.
She needs to put together as detailed a time line of the harassment as possible - for each incident, put down time, place, what happened, any documentation, any witnesses. Keep it updated. As a defensive measure and to keep in reserve, try to work out what actions or incidents on the part of the OP's friend might be used in retaliation and what the response might be, again setting this out in full in documentation. If something is raised in retaliation, it is much better to have an immediate answer rather than being blindsided by it. The OP's friend needs to have an immediate response ready to whatever might come her way as a complaint against her.
The OP and her friend need to work out who in the program hierarchy is going to be on her side. Start with those who have an organisational role supporting residents - Chief Resident? Resident Adviser? Union official if a union is recognised by the program (even if the OP's friend is not a member, she may be able to join up on the spot, rather than needing to be a member before the trouble started - unions are much nicer to their members/customers than insurance companies are). Go to that person with the timeline document and discuss what the best approach is. What does the OP's friend want - the harassment to stop, presumably, but anything else? What does the resident's contract say about this - what standards of behaviour is the resident entitled to expect, what formal procedures are in place for a complaint?
If there is no one in the program who is formally on the resident's side, find the person in the hierarchy who has the responsibility for managing these issues, and have a meeting with them, making clear that the meeting is with them in their capacity as the person dealing with harassment issues. Any meeting, take someone along to be a witness/take notes. Also note phonecalls (time, who with, short précis of what was said) and keep any documentation.
Sometimes the least confrontational approach is the best place to start - a private word from a person in the hierarchy to the harasser (eg (you may not realise, your actions unwelcome, if you stop it, it won't go further), then if that does not work, escalate to a formal complaint.
It sounds as if the problem is serious enough that the OP wants/needs it to stop asap. If that is the case, she needs to put her offence and defence in place immediately, and then make an informal or formal approach to the hierarchy without waiting for the end of rotation, etc.
Good luck.