This is a common myth among people particularly in the Indian sub-continent. When you visit Adyar Cancer Institute in Chennai one of the prominent signs you will see is to emphasize that cancer is not contagious. There is no risk of getting cancer by attending to or taking care of a cancer patient.
National Cancer Institute (http://www.cancer.gov/), US federal agency for cancer research also confirms it. According to NCI cancer is not a contagious disease that easily spreads from person to person. The only situation in which cancer can spread from one person to another is in the case of organ or tissue transplantation. A person who receives an organ or tissue from a donor who had cancer in the past may be at increased risk of developing a transplant-related cancer in the future. However, that risk is extremely low—about two cases of cancer per 10,000 organ transplants. Doctors avoid the use of organs or tissue from donors who have a history of cancer.
In some people, cancers may be caused by certain viruses (some types of human papillomavirus, or HPV, for example) and bacteria (such as Helicobacter pylori). NCI also confirms that while a virus or bacterium can spread from person to person, the cancers they sometimes cause, cannot spread from person to person.