While the exact dance between anxiety and sunlight is still somewhat in the dark, researchers are seeing a connection. With depression, levels of serotonin—the neurotransmitter linked to such things as mood, sleep, sexual function, and more—drop. Low serotonin levels can be an important factor in depression and seasonal affective disorder.
The effect of sunlight is a bit more indirect with anxiety, but there is indeed a connection. While there doesn’t appear to be a direct cause-and-effect relationship between the two, people can and do experience increased anxiety and panic in response to decreased sun exposure. (Note: Anecdotal, but not scientific, reports indicate that some anxiety sufferers experience more anxiety during the summer months when their sun exposure is higher. Again, a clear causal relationship hasn’t been established.)