The findings are based on the blood analyses and pain scores of almost 7000 45 year old men and women from across England, Scotland and Wales, all of whom were born during one week in March 1958.
Smokers, non-drinkers, the overweight and the underweight all reported higher rates of chronic pain.
The extent of chronic widespread pain did not vary among men according to vitamin D levels. However, this was not the case for women.
Women with vitamin D levels between 75 and 99 mmol/litre had the lowest rates of this type of pain, at just over 8%.
Women with levels of less than 25 mmol/litre had the highest rates, at 14.4%.
There appeared to be a J shaped curve, with the prevalence of widespread pain at 10% or higher among those with vitamin D levels above 99 mmol/litre.
The findings were not explained by gender differences in lifestyle or social factors, such as levels of physical activity and time spent outdoors, say the authors.
And at the age of 45, few of the women would have entered the menopause, a period during which bone mineral density falls as oestrogen levels dwindle.
But by way of possible explanations, the authors point to osteomalacia, a disease of extreme vitamin D deficiency, which is associated with isolated or generalised bone pain. The hormonally active form of vitamin D is also involved in the regulation of immune system responses.
Around one in 10 of the population suffers from chronic widespread pain at any one time, say the authors.
The causes are not fully understood, but social and psychological factors are known to affect the sensation and reporting of pain.