https://i.ytimg.com/vi/VPB9QEbEJbw/hqdefault.jpg
This is a video for Blender Cycles render that shows how to produce a shadows only effect using compositing similar to the Shadows Only material in the Blender internal render. I demonstrate two methods one of which allows you to save the result as an image that can be used in the video sequence editor.
source