Magnificent Obsession is a 1929 novel by Lloyd C. Douglas. It was one of three of his books that were eventually made into blockbuster motion pictures, the other two being The Robe and The Big Fisherman.
Robert Merrick is resuscitated by a rescue crew after a boating accident. The crew is unable to save the life of Dr. Hudson, a doctor renowned for his ability to help people, on the other side of the lake who was having a heart attack at the same time. Merrick then decides to devote his life to making up for the doctor's, and so he decides to become a physician (specifically a brain surgeon).
In the movie, before deciding to become a surgeon Merrick not only alienates the doctor's widow, with whom he has fallen in love, but also causes another tragedy.
This makes him totally re-evaluate his life, and decide to become a doctor.
The book plot differs in that Mrs. Hudson, the widow, moves to Europe after Joyce, the daughter of the doctor, marries. Merrick progresses in his career and the final climax of the book involves a railway accident in which Mrs. Hudson suffers a brain injury. Merrick is instrumental in her recovery.
The story behind the novel, and the identity of the surgeon on whose life it is based, is in this book review.
The theme of the book is based on a passage from the Gospel of Matthew (chapter 6:1-4):
"Take heed that ye do not your alms before men, to be seen of them: otherwise ye have no reward of your Father which is in heaven.....That thine alms may be in secret: and thy Father which seeth in secret himself shall reward thee openly."
Douglas wrote a later book in response to the flood of letters he received from readers who wanted to know where they could find the book he referred to in the novel, Dr. Hudson's Secret Journal, which Robert Merrick decoded, and from which learned the secret of the his extraordinary success as a doctor. (According to the book, the secret was the literal practice of doing good deeds secretly, and thereby reaping spiritual power to use in becoming an excellent doctor.)