Opioids are extensively used in patients with cancer pain; despite their efficacy, several patients can experience ineffective analgesia and/or side effects. Pharmacogenetics is a new approach to drug prescription based on the "personalized-medicine" concept, i.e., the ability of tailoring treatments to each individual's genetic/genomic profile. Pharmacogenetics aims to identify specific genetic variants that influence pharmacokinetics and pharmacodynamics of drugs, better determining their effectiveness/safety profile. Opioid response is a complex scenario, but some gene variants have shown a correlation with pain sensitivity, as well as with opioid metabolism and clinical efficacy/adverse events. Although questions remain unanswered, some of these gene variants may already be used to identify specific patients' phenotypes that are more prone to experience better clinical response (i.e., better analgesia and/or less adverse events). Once adopted, this approach to opioid prescription may improve a patient's outcome. This review summarizes the available data on genetic variants and opioid response: we will focus on basic pharmacogenetic and its impact in the clinical scenario discussing how they may lead to more appropriate opioid prescription in cancer patients.