I managed to get the thing I had in mind with the description posted above but I have a question:
I have a flat plane in front of the tube where the light is located. This plane has a default shader with an image in the opacity slot so it serves as a mask for my light - this works fine. However, even if the map has greytones, they get mapped to 0 or 100%. I cannot produce a gradient in the material's opacity, it's always either black or white. The funny thing is, it gets completely transparent when opacity's value is at .49999 and gets opaque when set 0.50001 - I don't know what's causing this but there's literally no space left to achieve semi-opaque effects.
Also, it seems there's no way to tint opacity. Since I cannot get any 50% value in the opacity, using diffuse for tinting opacity doesn't have any effect.
Is there any other way to achieve image-based opacity or transparency? If not, is there a way to make it accept gradients and tint opacity in the diffuse material?
I'd be very grateful for any insights, I have a request here where I need to use this effect and I'd like to do it in TG.