I find that spin class is more effective for me, because the instructor pushes me harder than I would push myself running. I find that running is hard on my knees and feet. However, making time to go to spin class can also be challenging.
A person who weighs 150 pounds, running an 8 minute mile (7.5 mph), would burn around 566 calories in 40 minutes. The same person would burn about 455 calories if bicycling vigorously (14-15.9mph). You can use the exercise calculator here to get a better assessment for yourself: http://www.prohealth.com/weightloss/tools/exercise/calculator1_2.cfm.
You'll probably burn more calories running, however, you're less likely to avoid injury cycling (as many other people have astutely pointed out). In spin class, it always seems like you're really sweating your brains out, but that is probably because you're stationary. I enjoy running outdoors and/or biking outdoors for this reason. Try calculating burning calories for various exercises here: http://www.healthstatus.com/calculate/cbc