The scan can identify dangerous plaques in the arteries which nourish the heart. If a fatty plaque ruptures, it can lead to a clot, blocking the flow of blood. Scientists at the University of Edinburgh said an effective tool for predicting a heart attack would make a "massive difference" to patients.
More than 100,000 people have a heart attack in the UK each year and disease of the arteries around the heart is the leading cause of death in the world.
The researchers used a radioactive tracer which can seek out active and dangerous plaques. This was combined with high resolution images of the heart and blood vessels.
The overall effect is a detailed picture of the heart with the danger zones clearly highlighted. The technology is already used to detect tumours in cancer patients.
The first tests of the technique for danger spots in the heart were on 40 patients who had recently had a heart attack.
The scan highlighted the plaque which caused the heart attack in 37 of the patients according to a study published in the Lancet medical journal.
It is the first time a scan has been able to identify danger zones but further tests are needed to see if detecting dangerous plaques before, rather than after, a heart attack has the potential to save lives.
"I suspect not all plaques detected will cause a heart attack, but it could be useful for identifying high risk patients who need aggressive therapy," cardiologist Dr Marc Dweck told the BBC.