You not calling, as a friend, can actually compound the grief and loss they are feeling. Just pick up the phone, even if you get it wrong, just have a conversation and do your best. Your friend with cancer is still the same person they were before.
No matter what you say to someone whose parent or loved one died, it should be derivative of the same goal: communicating empathy and offering assistance, understanding what a person might need from you, and knowing how to phrase sentiments the right way.
The definition of emotional intelligence is the ability to recognize, differentiate, and manage our emotions and the emotions of others. The notion of emotions being important in our lives goes all the way back to the ancient Greeks.