Retune your rigging! Your mast was probably set up without a slight 'forward bow' or 'prebend'.
Everything in the universe has a natural oscillation frequency. The wind was inducing the mast/rigging to oscillate.
The natural frequency can be changed either by changing the mass (hanging a rope, etc), by changing the rig tension .... or better by adding a slight forward bow (prebend) to the mast. This will change the natural frequency ... to a far different frequency.
A single spreader mastheaded rig 'should' have 3/4" forward prebend, a multi-spreader mast will have 1/2" bow for each spreader set. Your mainsail is cut by the sailmaker expecting this prebend ... or the sail will have more draft than designed.
How set prebend:
http://www.seldenmast.com/page.cfm?id=6740 then download according to your choice language This guide will apply to all 'common' masts and rig tuning.
There is a section in this manual that explains how to properly tension the rig without a tension gage ... just a 'meter stick' - you set up the rig by its measured 'stretch' or elastic strain simply by measuring that strain.
;-)