Genetics can play a significant role in the development of rare cancers. Some rare cancers are linked to hereditary syndromes, making genetic testing an important tool for both diagnosis and risk assessment. For instance, Li-Fraumeni syndrome is associated with a higher risk of developing several types of rare cancers.