The compounds of the invention are modulators of cannabinoid receptors CB1 or CB2. The compounds can be used for the prevention or treatment of, e.g., pain, cancer, skin diseases, weight-associated disorders, chemical addictions, psychiatric disorders, neurodegenerative disorders, bone diseases, and inflammatory diseases. The compounds of the invention can further be used to study these diseases and disorders, as well as cannabinoid receptor biology, by coupling the compounds to, e.g., imaging agents.