In a port starboard situation, the starboard boat has the right of way. The starboard boat should hail "starboard" (though not required) to the port tack boat when it's clear the boats are on a collision course. The port tack boat should respond "tack or cross" or "hold your course" if she will cross clear or duck behind the starboard tack boat. It's important that the port tack boat does everything in her power to avoid a collision and the starboard does not need to make contact to prove the port tack boat has committed a foul. In fact the future rules may include a rule about making contact when avoidable. The rules are for safety and to avoid collisions.
A Leeward boat has right of way over a windward boat. The leeward boat should hail "leeward" to the windward boat if the boats are on a collision course (though the hail is not required). If there are several boats to windward, the leeward most boat has rights over all of the windward boats and the next windward boat has rights over all the boats to windward of her but does not have rights on the boat to leeward. If a windward boat sails to close to a leeward boat and as a result a collision occurs, it is the windward boats foul. Windward boats must keep clear of Leeward boats.
A boat that is clear astern must avoid a boat that is clear ahead. The boat that is clear astern must do everything in her power to avoid a collision. This rule usually comes into play when a boat that is clear astern loses control or there is doubt to overlap and how the overlap was established. If a boat clear astern loses control and is on a collision course with a right of way boat clear ahead, the clear astern boat should hail the right of way boat. It's always faster to avoid a collision in a race. An overlap established from clear astern to leeward of a right of way boat does not grant the new leeward boat luffing rights. In this situation the leeward boat must sail her proper course to the next mark and is the right of way boat.
A boat not tacking has rights over a boat that is tacking. A boat that is tacking into a right of way position initially does not have rights over one who is not. Once a boat tacking into a right of way position has completed her tack as a leeward boat she becomes the right of way boat. If she completes her tack to windward then she is a give way boat.