Render and Preview are different I'm trying to create a simple scene like the scene depicted in the answer here:



I reproduced the Compositor and Volume scatter settings, and this is what I get when I render:



But in the Rendered viewport, the scene looks somewhat closer to what I'm trying to do:



I've tried branched path tracing and path tracing, I tried rendering without Compositing enabled, tweaked various settings, and read many questions on Blender SE about light rays but can't seem to understand why it won't work... 

Blend:
There is object named Plane.002 which is visible in rendering but not viewport. That's the culprit.

Hide it from render and you will get the same result in viewport and render.