Imagine being plagued with bad memories, images of such terrible trauma - an accident or an instance of abuse - that they produce an uncontrollable emotional reaction. Now imagine being able to wipe away the pain of those memories.

Scientists are working on a way to do just that. By studying how we lay down our memories, research shows that it is possible to select and alter the way memories are stored in our minds.

Roger Pitman, a psychiatrist at Harvard University, has already shown that giving certain drugs to victims of trauma when they were brought in to hospital meant that they were less likely to develop conditions such as post-traumatic stress disorder (PTSD). Now he believes he can even cure PTSD sufferers years after the event.

"Our theory about PTSD is that there's an excess of stress hormone that sears the memory too deeply into the brain," said Dr Pitman. "If we can block the effects of those stress hormones, we may be able to prevent people from getting these overly strong memories that can become PTSD."

The work takes advantage of the way memories - essentially networks of brain cells that each store information on a single event or object - are formed.

"When you form a new memory, it's not immediately stored in the brain," said Karim Nader of McGill University, Montreal. These new memories exist as temporary modifications to already-existing networks of brain cells that, over the course of a few hours, stabilise into networks of their own.

To get into the long-term memory, the temporary modification has to stabilise or fix into a new network of brain cells. The traditional view among neuroscientists has been that, once these memories become fixed, they are difficult to change.

But this view was challenged when Dr Nader carried out experiments on rats. He trained them to be fearful of particular stimuli, such as heat. He later made them remember those fearful memories by exposing them to the stimuli again.

Dr Nader found that calling up a fixed memory from deep in the brain made that memory go back to an unstable state, the same as a new memory, which then has to be re-stabilised if it needs to be stored. "If you block it from being restabilised, then the memory is essentially no longer there," said Dr Nader.

"Each time the synapse is activated, as it is memory, there are processes going on that could result in a strengthening or a weakening," said Dr Pitman.

How memories are fixed also depends critically on any emotional response we might have had at the time of the incident. "We can all better remember things that have emotional meaning to us than things which are neutral, so your first date, the first time you were in love, your first divorce," said Dr Nader. "When something emotional happens, it causes the release of adrenaline in the body. Via a cascade of receptor mechanisms in the brain this is going to turn up the intensity switch on the information that is being stored."

In conditions such as PTSD the emotional part of this fixing process is turned up so high that the memory sears itself deeply into the brain and ends up overwhelming that person for years afterwards.

Dr Pitman carried out a pilot study on humans where he gave patients at the Massachusetts general hospital who had recently undergone trauma a drug called propranolol, a beta-blocker used for decades to treat high blood pressure but which acts on the receptors in the brain involved in storing memories. He gave 19 victims of accident or rape either 10 days of the drug or 10 days of dummy pills.

Three months later, the patients listened to tapes describing their traumatic events. Dr Nader found that the people on propranolol had fewer stress symptoms than those on the dummy pills.

But for many PTSD sufferers the trauma might have occurred years before. "If you reactivate the trauma in somebody who has PTSD and that memory returns back to an [unstable] state, then maybe it means that memory can be manipulated," said Dr Nader.

Dr Pitman and Dr Nader, along with colleague Alain Brunet of McGill University have recruited around 20 people in the Montreal area who were traumatised a long as 20 or 30 years ago by child abuse, sexual assault or accidents. Traumatic memories will be brought to the front of their minds by talking to counsellors. This enables these memories to be modified by drugs before being stored again.

"The thing we're working on now is to have people who already have PTSD recall their memories and thereafter give them propranolol to reduce the re-storing of those memories, so the memory gets stored in a weaker version than it was originally stored in," said Dr Pitman.

But deleting memories is not the aim of this particular project because, for many PTSD sufferers, the bad memories are part of their identity. "What we want to do is turn it down a bit so it's not so overwhelming and bring them into a range where they're responsive to the traditional ways of treatment - therapy and psychiatric treatment," said Dr Nader.