The way in which atoms are connected to one another in three dimensions plays a significant role in the way in which a medicine can function. Crystallography is the most effective way of determining the three dimensional shape of molecules.
In nature, some molecules can be joined together in the same way with the same number of bonds but the three-dimensional shape can be different; there is a right hand and a left hand. If you think about your hands, you can't superimpose one hand on top of the other to make them the same. But if you put a mirror between your two hands, the reflections turn one into the other. In Chemistry, this is called chirality and the pairs of molecules are called optical isomers.
Nature is very good at making a left-handed or right-handed form and therefore your body also can identify one over another and even interact with each form in a different way. The importance of this is illustrated by the thalidomide disaster of the 1950s. Thalidomide was a medicine that was given to pregnant women to treat morning sickness. It was a very effective treatment. However, with time, they noticed that a significant number of children born to women who had taken the medicine were born with significant physical abnormalities such as deformed limbs. The treatment had to be withdrawn from use. The reason for this problem was that one hand cured the morning sickness problems and the other hand cause the birth defects. Obviously this isn't very good! In more recent times, different medical uses have been found for thalidomide such as treatment of some cancers.
Many medicines have left-handed and right-handed forms and crystallography is the only technique that can show the three- dimensional shape of the molecules to allow this to be worked out. It is often very hard to make just a right-hand or a left-hand and crystallography can be used to help determine how successful chemists have been or whether they have just made a mixture of the two.
Things aren't as simple as just making the molecule. The easiest way to take a medicine is through a tablet. This is easy to take and easy to manufacture often making cheaper medicines. So we have to truly understand the way that molecules are arranged in a solid and how this is related to how if functions when it gets into your body. However, it is not quite as simple as having one solid of each material; it is possible to put a molecule into a solid form in more than one way just by changing the arrangement of molecules in the three-dimensional brick wall. This is called polymorphism. The discovery of new polymorphs can cost the pharmaceutical industry millions!
In fact one of the most common medicines, paracetamol, has more than one solid form where the molecules are arranged in slightly different ways. The easiest form of paracetamol to make has a herring-bone arrangement of molecules in the solid and this means that it is hard to compact into tablets. In order to make tablets of paracetamol, a binding agent has to be added which easily forms tablets. If you buy cheap paracetamol, this is chalk and this explains the taste! If you buy more expensive paracetamol, it is a more complex binding agent which is a little more expensive but it tastes better.
There is however, another form of paracetamol where the molecules are layered and this means that when pressure is applied to form a tablet, the layers can slide against one another. Pure paracetamol tablets can be formed. So why don't they use this other form of paracetamol? Because its harder to make and, it is less stable than the other form which means that the molecules can rearrange themselves into the herring-bone form by themselves. This would result in a crumbling of the tablets and not a very good product!
Ritonavir is use as a HIV treatment. It was introduced in 1996 and marketed as a multi-million dollar global therapy under the name Norvir by Abbott Laboratories. After 18 months, however, problems in the manufacturing process meant that a precipitate started to form in the product and it started to become less soluble. Abbott admitted that they had encountered problems in summer 1998 saying “We have encountered an undesired formation of a Norvir (Ritonavir) crystalline structure (Form II) that affects how the capsule form of Norvir dissolves". So a new form of Ritonavir had been found where the molecules were arranged differently in the crystal. This form was less soluble which made it less potent as a treatment. If a medicine can't get into your bloodstream it often doesn't work as this is the major way that things are transported around your body! They spent 100s of millions of dollars trying to get back to their original product but they couldn't find a way to make it again - it had disappeared! This is called a disappearing polymorph - the new form is more stable and once it has been made, there is nothing that can be done to persuade the molecules to do anything other than make a solid of the stable form. Abbott had to find a new way to formulate their product as a liquid gel which had to be refrigerated. It cost them ~250 million dollars in sales!
Now pharmaceutical companies have to do extensive experiments to determine whether any more polymorphs exist before they put a product out on the market. Every now and again polymorphism unexpectedly pops up to cause a problem again though!
Making a molecule that acts as an effective medicine is not the end of the story. We can make the most effective medicine possible that works well in a test tube, but if there is no way of delivering that medicine to ensure that it gets to the right place in the body, then it is no use! The easiest way to take a medicine is orally and so it needs to be soluble enough to get into your bloodstream so that it can be transported around your body. Finding different polymorphs can be a way to improve solubility as one polymorph may be more soluble than another. Another way to improve solubility can be to grow crystals of a salt, for example sodium and chloride salts are common. It is also possible to grow crystals with more than one molecule contained within them. The molecules are not chemically altered and co-exist so that when the solid dissolves, the medicine is able to act in exactly the same way as if a solid had been made of the medicine on its own. These are known as co-crystals and there is a lot of current research going on in this area as significant improvements in solubility can be obtained through this route.