3d reverse masking of volumetric
Volumetric Cube catching Torus Light
Is this what you are looking for?

Cube with Principled Volume Shader
(Density 0.1 / Anisotropy 0.95)
Torus with Emission Shader
(Properties editor &gt; Object &gt; Visibility &gt; Ray Visibility &gt; Camera OFF)

So what you see is only light rays catching on Volumetric


Something more colourful ... Torus with Noise texture and Displacement Modifier.