Flexeril and Diazepam are both used to treat muscle spasms. They belong to two different drug classes - muscle relaxant and benzodiazepine, respectively. Both are advised for short-term use only. The only salient difference is that Valium has a higher potential to cause drug dependency than Flexeril. However, your physician can better decide which drug is better for your back pain.