You need some kind of particulate and a dark room. The more opaque the object is, the better the rays will be since you won't get spill lighting up the rest of the scene/particulate. Another way, which is probably easier and certainly cleaner, is to use smoke. Do a slow exposure, and have the entire scene VERY dark. The reason for this is to accentuate the faint beams you'll get. The wafting smoke should create a nice mostly uniform beam. Also ensure that your beams are as tightly focused as possible. In your pumpkin, for instance, you might have tried tapering the hole, so as it got closer to the surface it got narrower. As for making smoke, I would try something like what beekeepers use, since you can direct the smoke and produce a good amount. Unless you have access to a smoke machine...
That's how I would do it, anyway.
Here's an example of using the powder.
 |