So three wires mean that one is ground, one is low beam, and one is high beam. Ground can either be black or green (Black for yamahas green on hondas and who knows for whatever else). That wire is going to be used in both circuits. Of the two remaining wires, only one of them will carry a current depending on your beam switch. You would need to figgure out which wire is high and low and hook it up accordingly.
Easiest way to do this is with a multimeter. To find the ground wire, set the meter to measure resistance and put one lead on the cylinder head and poke each of the lamp wires. Two of them should return an infinate measurement and one should say somewhere between 0 and 1. Thats the ground.
To get the others, the ped has to be running (normally). So start up the engine and then set the meter to read ACV, which is alternating current voltage. Set your switch to low beam, put one lead on the ground wire and look for which of the two remaining wires has a voltage. That will be your low and the third will logicaly be your high beam.
Angrydwarf is right about bulbs though, they are passive and will respond well to any voltage, current, or polarity. Rule of thumb though, if you seem to burn bulbs out quickly, increase the power rating of the bulb.
Hope that helps.