The study found that in the year after losing a spouse to a heart attack, partners were three times more likely to start taking anti-depressants.
Even if their partner survived, the use of anti-depressants still increased by 17%, compared with the year before.
The use of anxiety drugs also went up, the European Heart Journal reports.
There are about 340 heart attacks in the UK every day - approximately 13% are fatal.
Maureen Talbot, senior cardiac nurse at the British Heart Foundation, said: "A heart attack can impact the whole family, and this study emphasises the importance of caring for the partners of heart attack sufferers.
"We know that people can feel anxious or helpless when a loved one has a heart attack. It is essential they receive the emotional and practical support they need during this often traumatic time."
This is the first study to look at the health of spouses after their partner survives a heart attack.
It also found men were more susceptible to the effect than women.
Report author Dr Emil Fosbol, from Duke University Medical Center, said: "This is a major public health issue for which there seems to be very little awareness among doctors and policy makers.
"The most important finding of this study is that the system needs to consider the care needs for the spouses too, not only when a patient dies from a [sudden heart attack], but also when the patient is 'just admitted' to hospital [after a sudden heart attack] and survives."
Using Danish registries, including the National Civil Status Registry that shows whether people are married or not, researchers studied 16,506 spouses of people who died from a sudden heart attack between 1997 and 2008 and 44,566 spouses of patients who survived a sudden heart attack.
Extreme health impact
They also looked at the use of anti-depressants and drugs to treat anxiety before and up to a year after the event, and medical records for depression and suicide.
The scientists also compared this data with the health of 49,518 people whose partners died from causes unrelated to a sudden heart attack, and 131, 563 spouses of people admitted to hospital for a non-fatal condition unrelated to a sudden heart attack.
If the partner had a heart attack, the spouse's health was more seriously affected than those whose partners died from or survived other medical conditions.
The researchers speculate that it is the sudden and unexpected nature of a sudden heart attack that causes the more extreme impact on the spouse.
Dr Fosbol said: "If your partner dies suddenly from a heart attack, you have no time to prepare psychologically for the death, whereas if someone is ill with, for example, cancer, there is more time to grow used to the idea.
"The larger psychological impact of a sudden loss is similar to post-traumatic stress disorder."
By Anna-Marie Lever, BBC News