A pioneering programme to test cancer patients for nearly 100 risk genes is to start in London and could represent the future of treatment in the NHS.
It will look for genes such as those which led Hollywood actress Angelina Jolie to have a double mastectomy.
The results will be used to pick targeted drugs or decide how much of the tissue around a tumour to remove.
It will also highlight patients at high risk of additional cancers, who need to be monitored closely.
A person's genetic code is like an instruction manual for building and running their body.
However, faulty instructions can increase a person's risk of developing cancer. Some people with BRCA gene mutations have an 80% risk of breast cancer.
The testing will be run by the Institute of Cancer Research and The Royal Marsden hospital in London.
Prof Nazneen Rahman, lead investigator of the programme said: "It is very important to know if a mutation in a person's genetic blueprint has caused their cancer.
"It allows more personalised treatment, so for example such people are often at risk of getting another cancer and may choose to have more comprehensive surgery, or may need different medicines, or extra monitoring."
For example, a patient with colon cancer may choose to have a large section of their bowel removed, rather than just the tumour, if it turned out they were at very high risk of colon cancers and were likely to develop more later in life.
Around 2% of all cancers are down to such genetic changes, but it varies hugely between cancer types. In ovarian cancer, 15% are due to a genetic predisposition to developing tumours.
Prof Martin Gore, the medical director of the Royal Marsden, said this would be "an exciting change of practice", which patients were ready for.
"Patients want to know. I'm asked several times a day, 'Is this hereditary?' There's no point pretending that patients don't want to know."
But Prof Gore warned this was a new idea, so any downsides to testing, such as how families might deal with the extra information, remained unknown.
Finding out if a cancer was caused by these genes also allows family members to be more aware of their risk.
The test, developed by biotechnology firm Illumina, looks for 97 genes which increase the risk of cancer. More risk genes can be added to the test once they are discovered.
It is available for use in other hospitals, but the researchers say this is the first attempt at introducing mass cancer-risk gene testing as a cornerstone of treatment.
The objective of the programme, funded by the Wellcome Trust, is to come up with the best way for such testing to become the standard across the whole NHS.
It will start with women with breast or ovarian cancer by 2014.
Prof Peter Johnson, Cancer Research UK's chief clinician, said: "Researchers now have a wealth of information about the inherited gene faults that increase a person's cancer risk, and this knowledge can help tailor treatments for patients whose cancers are linked to these mutations.
"This exciting new initiative will help embed genetic testing into routine NHS cancer care, and hopefully allow more cancer patients to benefit from genetic testing - and more personalised care - in the future."
Dr Caitlin Palframan, from Breakthrough Breast Cancer, said: "This programme has a lot of potential as this type of testing may help lay the ground for more personalised treatment for people with breast cancer.
"It is vital however that appropriate genetic counselling is offered if this testing is likely to identify any genetic risks within the person's family and we hope that this is being considered."