。
She said she had a headache.
Literal
She [topic-は] headache [subject-が] does [quotative-と] said.
頭痛がする uses ~がする to express a physical sensation — the headache 'does' or 'occurs' to the speaker. This is the standard pattern for bodily sensations in Japanese: [symptom]がする. The quotative と + 言った wraps the whole clause as reported speech.