One might ask: are there ghosts or not? The answer is yes. Should we worship them or not? The answer is both yes and no. Didn’t Confucius tell us to “respect all spirits and deities but keep them at a distance”? That single statement captures all the nuance of the matter.
To “respect” means that ghosts do exist; To “keep them at a distance” implies a form of veneration that stops short of blind devotion.
One should make them offerings at the proper times and interact with them according to ritual propriety — nothing more. To believe excessively and offer servile worship — hoping for the bestowal of fortune telling, blessings, or supernatural interventions — is to quickly head into the wicked path of heterodoxy.
Only the Buddhas and Bodhisattvas are worthy of our respect at close range! Why do people not reflect upon this?
by Grand Master Lian Chi (蓮池大師), the Eighth Patriarch of Pure Land Buddhism
鬼神 – 錄自明末蓮池大師《竹窗隨筆》(初筆)
或問: 有鬼神歟? 無鬼神歟? 曰: 有。鬼神可信奉歟? 不可信奉歟? 曰: 亦可亦不可。何謂也? 曰: 夫子不云乎「敬鬼神而遠之」! 蓋一言盡其曲折矣! 「敬」之云者,有也。「遠」之云者,信奉而不信奉也。祀之以時,交之以禮,如是而已耳。過信而諂奉焉,冀其報吉凶、降福佑、獲靈通,則駸駸然入於邪矣。噫! 有可敬而不可遠者,諸佛諸菩薩是也。胡弗思也?

