When I saw the ghost, I was so scared my hair stood on end.

Literal

Ghost [object-を] see-[past-た] time, I [topic-は] very scared-[so-くて] head-hair [subject-が] stand-on-end-[past-った].

A classic horror-story cadence. 頭髪がさかだつ ('one's hair stands on end,' literally 'head-hair stands up reversed') is an idiom identical to English. The te-form 恐くて chains fear to the physical reaction — 'scared, [and] hair stood.' Great example of te-form-for-cause linking emotion to consequence.