The Daimonji Festival or Gozan Okuribi has superstitious origins. This festival marks the zenith of Obon, a holiday period all over Japan from August 13-16. It entails welcoming back the spirits of ancestors, then sending them off again. In stark contrast to the goryo (evil spirits) of the Gion Festival, these spirits are not considered evil or vengeful. Activities such as the Bon Odori-dance for ancestors are held throughout this period and the Daimonji Festival marks the end of Obon.
From long ago, Japan seems to have practiced a time honoured ritual, paying respect to ancestral spirits. Today, it’s referred to as Obon. Originally, people apparently lit torches and raised them into the sky to light the way for ancestral spirits. Now-a-days, the torches have been replaced with burning pyres of wood, etched into the shapes of Chinese characters on the hillsides surrounding Kyoto.
There are a few stories as to the origins of the characters. One strong possibility involves Shogun Yoshimasa Ashikaga who commissioned the [大] character into the side of Daimonji mountain to commemorate the spirit of his recently passed son Yoshihisa. This coincided with Obon ritual and seems to have eventually become part of the Obon ritual all together. Yoshihisa passed away at the young age of 24. His apparent life of debauchery might have been a major cause of the brain aneurism that caused his early death.
As you can imagine, Yoshimasa was deeply saddened over the loss of his only son and heir to his title and estate. Yoshimasa is said to have watched the inaugural lighting of the 大 character from the Togudo- (small dwelling at Ginkakuji), at the foot of the Daimonji mountain. This seems to be the origin of the present Daimonji Festival.
◊ Information from Wikipedia; 臨済相国寺派 Homepage; Japanese Buddhist Statuary Homepage