What is this low-voltage thing on my attic light
It's a transformer (converts from normal household voltage to low voltage.)

Turn off power to that light (i.e. find the breaker that shuts it off) and then try to ring the doorbell.

Certainly that wire appears to be the normal doorbell wire, and doorbells are a very normal thing to be fed off such a transformer.