The phenomenon you're talking about was a fad in the 60's, called 'interanimal memory transfer'. It started out when James McConnell performed a later-discredited experiment in which he found that if you chopped up flatworms which had been exposed to some stresses, and fed them to other unexposed flatworms, the unexposed worms became wary of the source of stress quicker after eating their dead companions. He jumped to the conclusion that a 'memory molecule' was being transferred, and that the cannibal worms gained the food worms' memories of the stress.
People then started looking to see if they could:
- repeat the experiments
- find the same phenomenon in other animals
In the first case, nobody could replicate the experiments in worms, but because McConnell was such a PR genius he managed to convince the public that his results were valid (see Rilling, 1996 for more on this).
In the second case, Frank et al. (1970) and others tried working with rats - I think this is the experiment you're talking about in the question. They found various interesting results including that if you trained rats to run through a maze by using particularly stressful negative reinforcement (like electrocution), then those rats' children would be able to learn the new maze much faster. However, Frank et al. didn't make the same mistake as McConnell - first of all they wondered if the parent rats might be leaving a scent trail. So they used duplicate mazes with the exact same design, putting the children into clean mazes. The children of adults who had already learned the maze continued to outperform the control rats - the explanation was not scent trails.
Next they wondered whether it might be that the second generation rats had been born with a higher wariness as a result of the stress their parents suffered; i.e. it could be a hormonal transfer from mother to child (e.g. cortisol, the stress hormone).
Frank et al. tested their hypothesis by torturing some rats for a while (rules about animal welfare were not strict in the 70's). They would lock some rats in a small jar and bash them about for a long time, then kill them, chop them up, and take out their livers. They fed the livers to other rats, and found that after eating the livers the other rats learned the maze much faster. They interpreted the results in what now seems a sensible light: the stressed rats were producing high concentrations of a stress-signalling molecule. When those rats either had children or were fed to other rats, they passed on high doses of the stress molecule. This raised the alterness and wariness of the receipient rats so that they were much quicker to learn which parts of the maze were dangerous.
There is no evidence that the child rats actually 'remembered' the maze - they still had to find their way around, but they were extremely wary of the electrocution plates and so avoided them, finding the safest way to the end. This is not a case of genetic memory.