Understanding of how energetic charged particles damage DNA is crucial for improving radiotherapy techniques such as hadron therapy and for the development of new radiosensitizer drugs. In the present study, the damage caused by energetic particles was simulated by measuring the action of extreme ultraviolet (XUV) attosecond pulses on the DNA building blocks thymine and thymidine. This allowed the ultrafast processes triggered by direct ionization to be probed with an optical pulse with a time resolution of a few femtoseconds. By measuring the yields of fragment ions as a function of the delay between the XUV pulse and the probe pulse, a number of transient processes typically lasting 100 femtoseconds or less were observed. These were particularly strong in thymidine which consists of the thymine base attached to a deoxyribose sugar. This dynamics was interpreted as excited states of the cation, formed by the XUV pulse, rapidly decaying via non-adiabatic coupling between electronic states. This provides the first experimental insight into the mechanisms which immediately proceed from the action of ionizing radiation on DNA and provides a basis on which further theoretical and experimental studies can be conducted.