Is it possible to visualize ray length info as a black and white map?
Connecting the emission shader directly, as you suggested won't work indeed, but how about mix of transparent and emission depending on Geometry->Backfacing? Should work.

Edit:
Works for me: