Are Drugs Haram?
Question

In recent times the phenomenon of drug-taking has increased, especially hashish, because the people think that it is not khamr that befogs the mind.
 My question is – is it really khamr (an intoxicant)? If a person drinks khamr, will his prayer not be accepted for forty days? In that case, how valid is the fasting of one who smokes hashish during Ramadan?
Praise be to Allah.Are drugs haram?
There is no doubt that taking drugs is haram, including hashish, opium, cocaine, morphine, and so on. 
Why are drugs haram?
Drugs are haram for many reasons, including the following: 

Drugs dull the senses and befog the mind, and whatever does that is haram. The Prophet (peace and blessings of Allah be upon him) said: “Every intoxicant is khamr, and every intoxicant is haram. Whoever drinks khamr in this world and dies persisting in that and without having repented, will not drink it in the Hereafter.” (Narrated by Muslim, 2003) 

Al-Bukhari (4087) and Muslim (1733) narrated that Abu Musa said: The Prophet (peace and blessings of Allah be upon him) sent Mu’adh ibn Jabal and me to Yemen, and I said: O Messenger of Allah, there is a drink that is made in our land and is called al-mizr, which is made from barley, and another drink called al-bit’, which is made from honey. He said: “Every intoxicant is haram.” 
Al-Bukhari (4343) and Muslim (3032) narrated that Ibn ‘Umar (may Allah be pleased with him) said: I heard ‘Umar (may Allah be pleased with him) say from the minbar of the Messenger of Allah (peace and blessings of Allah be upon him): “O people, the prohibition of khamr was revealed when khamr was made from five things: grapes, dates, honey, wheat and barley. Khamr is whatever befogs the mind.” 
There is no doubt that drugs also befog the mind and take away reason. 
Al-Hafiz ibn Hajar said: The general meaning of the words, “Every intoxicant is haram,” is taken as evidence that whatever causes intoxication is haram, even if it is not a drink. So that includes hashish and other things. Al-Nawawi and others were certain that it is an intoxicant, and others were certain that it dulls the senses, and it is arrogant to say otherwise, because its visible effects are the same as those of khamr, such as euphoria and addiction. 
Even if we assume that it is not an intoxicant, it is proven in Abu Dawud that all intoxicants and relaxants are haram. And Allah knows best. End quote from Fath al-Bari, 10/45. 
Al-Khattabi said: Relaxants are those drinks that cause relaxation in the muscles and numbness in the extremities, which is the precursor to intoxication . It is forbidden to drink them lest they be a means that leads to intoxication. 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: Everything that takes away one's senses is haram, even if it does not result in drunkenness or intoxication. If it takes away the senses it is haram according to the consensus of the Muslims. With regard to using banj (lit. henbane) which does not cause intoxication or take away reason, this is subject to a ta'zir punishment.  
The scholars who studied the issue realized that hashish is an intoxicant, and that it is only consumed by evildoers, because of the pleasure and euphoria it brings. So it is like intoxicating drinks. Khamr makes a person lively and argumentative, whereas hashish makes him relaxed and lethargic, but it still befogs the mind and opens the door to physical desires and  heedlessness with regard to one's honour, which makes it worse than intoxicating drinks. This is something that was introduced by the Tatars. 
The one who consumes a little or a lot of it is to be subjected to the punishment for drinking: eighty or forty lashes, if he is a Muslim who believes that intoxicants are haram. End quote from al-Fatawa al-Kubra, 3/423 
It says in al-Siyasah al-Shar'iyyah (p. 92): 
“Hashish which is made from grape leaves is also haram and the one who does that should be whipped as the drinker of khamr is whipped. It is worse than khamr in a way, because it corrupts the mind and mood, and robs a man of his masculinity and makes him heedless about his honour, and other evil consequences. But khamr is worse in another way, because it leads to arguments and fights. Both of them keep a person from remembering Allah and praying. Some of the later fuqaha did not issue rulings on the punishment for it, and they thought that the one who consumes it should be given a ta'zir punishment that is less severe than the hadd punishment, because they thought that it alters the mind without causing euphoria, like banj (henbane). We have not found any comment on it among the earlier scholars, but that is not correct, rather those who consume it become addicted to it like those who drink khamr, if not more so, and it keeps them from remembering Allah and praying if they consume a great deal of it. It also causes other evil results such as heedlessness about one's honour and loss of masculinity, corruption of one's mind and mood, and so on. Because it is something solid and edible, and it is not a drink, the scholars disagreed as to whether it is najis (impure) and there are three opinions in the madhhab of Ahmad and elsewhere. It was said that it is najis like khamr that is drunk – this is the correct view; and it was said that it is not najis because of its solid state, and it was said that a differentiation should be made between its solid and liquid forms. 
Whatever the case, it comes under the heading of that which Allah has forbidden of khamr and intoxicants, whether by name or by nature. Abu Musa al-Ash’ari (may Allah be pleased with him) said: O Messenger of Allah, advise us with regard to two drinks that we used to make in Yemen: al-bit’ which is made of honey that is soaked until it becomes strong, and al-mizr which is made of wheat and barley until it becomes strong. The Messenger of Allah (peace and blessings of Allah be upon him) had been given the gift of comprehensive and concise speech and he said: “Every intoxicant is haram.” Agreed upon in al-Sahihayn.” 
He also said: “How about the person who persists in consuming hashish, especially if he believes that it is permissible, as some people do? Such a person should be asked to repent ; if he repents, all well and good, otherwise he should be executed, because intoxicants are haram according to scholarly consensus, and regarding them as permitted is undoubtedly kufr.” (Al-Fatawa al-Kubra, 2/309) 

Drugs cause a great deal of harm, which may be greater than the harm caused by drinking alcohol. The Prophet (peace and blessings of Allah be upon him) said: “There should be neither harming nor reciprocating harm.” (Narrated by Ahmad and Ibn Majah (2341); classed as sahih by al-Albani in Sahih Ibn Majah.) 

They cause harm to the person himself, to his family and children, and to his society and nation. 
With regard to the personal harm caused, they cause serious harm to both the body and the mind, because intoxicants and drugs destroy the health, nerves, mind, reasoning, the digestive system, and other negative effects which impact the entire body, and it damages his dignity and honour, as his personality becomes fragile, and he becomes a laughing-stock and suffers from numerous diseases. 
With regard to the harm that is caused to the family, this is the mistreatment of his wife and children, so the house is turned into an unbearable hell because of tension, anger, arguments, insults, repeated utterance of divorce (talaq), breaking of things, neglect of the wife, and not spending properly on the home. Intoxicants and drugs may even lead to the birth of children who are deformed or mentally handicapped. 
The harm that is caused to society is evident in the huge destruction of wealth with no positive return, which affects the man’s interests and leads to the failure to fulfil duties and loss of public trusts, whether that has to do with the interests of the state, institutions or individuals. This is in addition to the damage caused by criminal acts against people, property and honour. The harm caused by drugs is worse than that caused by intoxicants, because drugs destroy moral values. End quote from al-Fiqh al-Islami wa Adillatuha by Dr. Wahbah al-Suhayli, 7/5511. 
To conclude, no wise person would doubt that drugs are haram, because of the textual evidence that points to their prohibition, and because of the extensive harm that they cause. 
Punishment for taking drugs
With regard to the punishment for one who takes drugs, it is the same as the hadd punishment for drinking alcohol, as stated above by Shaykh al-Islam ibn Taymiyah with regard to hashish. Drugs come under the heading of khamr and intoxicants that have been forbidden by Allah and His Messenger. 
The scholars and da’iyahs have to explain to the people that these drugs are haram and point out the great harm that is caused by them. 
Will the prayer of drug-addicts be accepted?
With regard to your question about the prayer of one who drinks khamr not being accepted for forty days, and the ruling on his fasting, please see these answers: 20037 , 27143 ,  96702 . 
And Allah knows best.