This is actually an interesting topic.
Genetically - MJ is pre-programmed to come out 60% female.
The actual sex is not determined until the fourth or fifth week of veg. Depending on environment - I believe you can go as high as 90% males. There was a study done by Dutch Seeds - it is still available on the web - which included this result:
Of the 5 above-mentioned environmental factors the first three are the most practical:
Level of nitrogen and potassium of the seedbed: A heightening of the standard level of nitrogen makes for more female cannabis plants originating from the weed seeds. A lowering of the nitrogen level shows more male cannabis plants. A heightening of the level of potassium tends to show more male marijuana plants, while a lowering of the potassium level shows more female marijuana plants. A combination of a higher nitrogen level for the period of a week or two and a lowering of the potassium level is recommended.
Humidity and moistness of the seedbed: a higher humidity makes for an increase in the number of female cannabis plants from weed seed, a lowering for an increase in male cannabis plants. The same is valid for the moistness of the seedbed.
Level of temperatures: lower temperatures make for a larger number of female marijuana plants, higher temperatures for more male marijuana plants.
Colour of light: more blue light makes for female cannabis plants from seed, more red light makes for more male cannabis plants.
Hours of daylight: few hours of daylight (e.g. 14 hours) makes for more female individuals, a long day (e.g. 18 hours) makes for more male cannabis plants.