Supplements containing vitamin D are fairly cheap
The first evidence of how vitamin D deficiency and genetics interact to increase the risk of multiple sclerosis has been reported by researchers.
A UK and Canadian team found that vitamin D helps to control a gene known to increase MS risk, the PLoS Genetics journal reports.
It suggests that vitamin D supplements taken during pregnancy and early in life could prevent the disease.
More than 85,000 people in the UK are thought to have MS.
The condition results from the loss of nerve fibres and their protective myelin sheath in the brain and spinal cord, causing neurological damage.
It is not entirely clear what causes MS but other research has suggested vitamin D, produced in the body through exposure to sunlight, plays a part.
Specifically there is evidence that populations from Northern Europe have an increased risk of developing MS if they live in areas receiving less sunshine.
Various pieces of research have also pointed to genetic causes.
In the latest study, researchers at the University of Oxford and University of British Columbia looked at a section of the genome on chromosome six which had been shown to have the strongest effect on MS risk.
While one in 1,000 people in the UK is likely to develop MS, this number rises to around one in 300 among those carrying a single copy of the gene variant - known as DRB1*1501 - and one in 100 of those carrying two copies.
The researchers found that proteins activated by vitamin D in the body bind to a particular DNA sequence next to the gene, altering its function.
They believe that vitamin D deficiency in mothers or even in a previous generation may lead to altered expression of the gene in their offspring.
Exactly how the gene-environment interaction alters MS risk is yet to be determined; one explanation could be an effect on the thymus - a part of the immune system which produces T cells to attack invaders such as bacteria and viruses.
It is thought that in people who carry the gene variant, a lack of vitamin D during early life might impair the ability of the thymus to delete rogue T cells, which then go on to attack the body, leading to a loss of myelin on the nerve fibres.
Co-author, Professor George Ebers, from the Wellcome Trust Centre for Human Genetics, at the University of Oxford, said it had been known for a long time that genes and the environment determine MS risk.
"Here we show that the main environmental risk candidate - vitamin D - and the main gene region are directly linked and interact."
Study leader, Dr Sreeram Ramagopalan, added: "Our study implies that taking vitamin D supplements during pregnancy and the early years may reduce the risk of a child developing MS in later life."
Simon Gillespie, chief executive of the MS Society, said: "These remarkable results tie together leading theories about the environment, genes and MS but they are only part of the jigsaw.
"This discovery opens up new avenues of MS research and future experiments will help put the pieces together."
The government already advises that pregnant and breastfeeding women make sure they get enough vitamin D, taking supplements if necessary.
And it is also recommended that children under five take daily vitamin D supplements.