Bats are very interesting animals. They have fascinated movie makers since the beginning of movie production, creating monsters and heroes alike. A lot of the bad rep that bats get comes from being nocturnal, but in reality, unless a bat has rabies, it won’t come close to a human unless it is stuck in an enclosed space. Bats are actually really good neighbors, since they eat thousands of mosquitoes every night. However, while they are good neighbors, they aren’t very good houseguests. If you have bats in your attic, you will be dealing with their disease carrying guano, or droppings. It also makes your attic difficult to access, since turning the light on up there could set the bats flying around.
It is possible that having a light on constantly in your attic could discourage bats from spending the night there since they are nocturnal. If this doesn’t help, you will need to block any entrances that they might be using to get into the attic, but just make sure they are out of it first.