You do a linepick from the light to the camera (or the other way round) and see if anything gets in between. When the light isn't in view you fade it's alpha quickly down to zero, and the reverse when it comes back into view. This gives it a persistance of vision effect, and as a happy by-product means you only have to check one light per frame.