Cannabis contains hundreds of chemical compounds, many of which are cannabinoids. Because of their chemical composition, cannabinoids have been linked to providing relief from chronic pain. As a result, cannabis by-products like medicinal cannabis are often used to treat chronic pain.