You do not need to stay for the entire visitation, but try not to leave during any prayers that might be offered. While there is no substitute for a personal visit if you are able to do so, there are many other ways to express your sympathy. E-mail is appropriate from those who are not intimate with the family such as a business associate or a former neighbor. The family will appreciate your message of concern. Flowers can be a great comfort to the family and may be sent to the funeral home or to the residence.
Some people prefer to send flowers to the residence afterwards.
If the family asks that donations should be made in lieu of flowers, you should honor that request. The most welcome gift at this time is food. Also, there may be several visitors in the house who need to be fed. During the days immediately following the death, substantial dishes that require little preparation other than reheating are appropriate. If the deceased was Catholic, some people will send a mass card instead or in addition to flowers.