Does cognitive loss lead to dementia? Yes. Is vitamin D important to the risk of cognitive loss? Yes. Do those levels also influence the ability to think (cognitive ability)? In 2002, 252 people were assessed for vitamin D levels, signs of dementia and cognitive ability. And, in 2012 another assessment was completed. The data was then assessed to determine if the initial vitamin D levels were associated with different risks of dementia and cognitive ability after 10 years.
Cognitive ability results:
First of all, those with higher vitamin D levels at the beginning of the ten-year period had about 40% better executive functioning at the end of the period compared with those who had lower vitamin D levels (executive functions are a set of processes that all have to do with managing oneself and one’s resources in order to achieve a goal, and they can be viewed as the “conductor” of all cognitive skills.)
Of course, vitamin D levels are determined by the quantity of sun exposure one receives. Therefore, we could say that vitamin D levels are a surrogate measurement of sun exposure.
Other research on sunlight and cognitive ability:Much research has been done on the association of sun exposure on cognitive abilities, so this research is no surprise. Especially relevant are the results of more recent research, based on a 15-year residential history of varying degrees of sun exposure. It has also shown cognitive impairment in persons who were below the median exposure to sun was 88% greater than those who were above the median. Researchers mentioned vitamin D as a possible mechanism by which sun positively influenced cognitive abilities. And, they also remarked that regulation of the circadian rhythm by sun could be a factor. Additionally, these same investigators had previously shown the following: lower levels of sun exposure resulted in a 2.6-times higher incidence of cognitive impairment.
Does BDNF play a part in protecting cognitive ability?
Part of the reason for better cognitive skills under the influence of sun exposure may not have anything to do with vitamin D. It could be due to a chemical called Brain-derived neurotropic factor (BDNF). It is a part of a cascade of proteins promoting growth of neurons and preventing nerve death. It is especially relevant that BDNF levels have been shown to increase significantly after bright light exposure. And, in what I would consider to be a remarkably important study, both light exposure and treadmill exercise increased the expression of BDNF in rats. And—as the researchers showed—exercise and/or bright light promoted neurogenesis (new nerve cell growth) in the adult rat brain. How important is this finding for adults who are worried about cognitive decline? Furthermore, we are actually seeing an example of new brain cells being built by bright light and exercise! Researchers have shown that BDNF has an effect on behavior, mood (e.g. depression), and brain adaptation (e.g. plasticity) and that its levels fluctuate seasonally in correlation with the amount of ambient sun:
In addition, we can add one more natural chemical inversely associated with cognitive decline, depression, memory loss, and nervous system degeneration, and directly associated with sun exposure. We now have vitamin D, serotonin, endorphins, dopamine and BDNF. Hence, sun exposure is absolutely necessary to human health. Be sure you are obtaining your share! Don’t let your mind deteriorate due to avoiding the sunlight.
Embrace the sun, but do it safely. Finally: avoid sunburn.
 Alicia M. Goodwill, Stephen Campbell, Steven Simpson Jr, Maria Bisignano,
Cherie Chiang, Lorraine Dennerstein, Cassandra Szoekea. Vitamin D status is associated with executive function a decade later: Data from the Women’s Healthy Ageing Project. Maturitas 107 (2018) 56–62
 Kent ST, Kabagambe EK, Wadley VG, Howard VJ, Crosson WL, Al-Hamdan MZ, Judd SE, Peace F, McClure LA. The relationship between long-term sun radiation and cognitive decline in the REGARDS cohort study. Int J Biometeorol. 2014 Apr;58(3):361-70.
 Kent ST, McClure LA, Crosson WL, Arnett DK, Wadley VG, Sathiakumar N. Effect of sun exposure on cognitive function among depressed and non-depressed participants: a REGARDS cross-sectional study. Environ Health. 2009 Jul 28;8:34
 Tirassa P1, Iannitelli A, Sornelli F, Cirulli F, Mazza M, Calza A, Alleva E, Branchi I, Aloe L, Bersani G, Pacitti F. Daily serum and salivary BDNF levels correlate with morning-evening personality type in women and are affected by light therapy. Riv Psichiatr. 2012 Nov-Dec;47(6):527-34.
 Kwon SJ, Park J, Park SY, Song KS, Jung ST, Jung SB, Park IR, Choi WS, Kwon SO. Low-intensity treadmill exercise and/or bright light promote neurogenesis in adult rat brain. Neural Regen Res. 2013 Apr 5;8(10):922-9.
 Molendijk ML, Haffmans JP, Bus BA, Spinhoven P, Penninx BW, Prickaerts J, Oude Voshaar RC, Elzinga BM. Serum BDNF concentrations show strong seasonal variation and correlations with the amount of ambient sun. PLoS One. 2012;7(11):e48046.