This is a variation on the team race exercise 'Piggy'.

The object is for a leeward boat to get ahead or into a controlling position of the windward boat.
The easiest way is to run this upwind towards a mark.  The boats lie to with masts level and as close together as possible, on the shout of 'GO' they both harden up and the competition begins.  The leeward boat can use any known tactics to get ahead which can include rules, gybing, creating space between the boats to enable a tack or even slowing down to enable a tack.
As soon as the leeward boat gains the advantage or the windward boat sails away reset the boats and start again.
This can be done with different types of boats if the sailors are of a lower skill but both helms need to be evenly matched in terms of boat speed and upwind sailing skills.
If the sailors are more advanced then this can also be tried sailing downwind between 2 marks but more knowledge about match racing rules and mark rounding needs to be known.