Why do spiders make their webs near the ceiling and near light sources ? Is their an advantage for spiders in doing that? For example do they catch more insects when their web is near a light source because prey insects are drawn to it, hence giving those spiders with a well-lit web a better chance of survival?
Because many insects (their food) are attracted to light. This attraction is called phototaxis.
Hypotheses for why insects are attracted to light
The leading hypothesis for why so many insects are attracted to light is that before artificial existed, insects were using the light from the moon in order to navigate. They would keep themselves at a given angle relative to the light source in order to navigate straight.
Another hypothesis is the presence of light indicates that the pathway is clear.
A third hypothesis is that some insects may confuse artificial light source with the other sex. This appeared to be true for moths for example
These three hypotheses are not mutually exclusive.
How do spiders chose their habitats
For more information about the abilities of spiders to find a good habitat, have a look at this very interesting answer.