The Tang (618–906) and Song (960–1279) dynasties were periods of dynamic religious transformation and revival in China, as well as profound philosophical inquiry. The religious landscape was varied and colorful. Along with the ancient indigenous religion, Taoism, Tang dynasty China enthusiastically embraced major religions imported from abroad: Buddhism, Christianity and Islam. During the Song period, Christianity disappeared from China, but Taoism and Buddhism continued to flourish and Islam began to take root. The popularity of these religions challenged the longstanding supremacy of Confucianism as the most influential philosophy in social and political life. In response, Song Confucian scholars developed a revised theory of Confucianism that assimilated certain Buddhist and Taoist elements. This philosophy became known as Neo-Confucianism and eventually reclaimed for Confucianism its role as the most influential social ideology in China. Buddhism, Taoism, and Confucianism were the three major influences on Chinese life and art during the Tang and Song dynasties—sometimes competing with each other but often synthesizing and evolving together in ways that were uniquely Chinese.
During the Tang and Song dynasties, the most conspicuous features of the religious landscape were the open rivalries as well as the relatively peaceful coexistence among different religions. Thus, the boundaries between different religions were fluid in two senses. First, through competition, different religions interacted with and influenced each other. Thus, while Buddhism and Taoism competed constantly for converts, they never excluded each other. For instance, early Buddhists frequently adopted Taoist terminology when they translated Indian sutras from Sanskrit. Taoists, for their part, also incorporated many Buddhist practices into their philosophical system. A notable example is the celibacy of the Taoist priests. Originally, Taoism did not require its priests to be celibate. However, as part of its interaction with Buddhism, a Taoist movement emerged during the Song which stressed priestly celibacy. As a result, today some branches of Taoism mandate clerical celibacy, while others do not. This tendency toward competitive religious interaction is likewise seen in the Nestorian adoption of Taoist and Buddhist concepts to facilitate the spread of Christian doctrine. Even Neo-Confucianism, which was in some ways a Confucian reaction against theistic religion, drew a great deal from Taoism and Buddhism in order to rejuvenate itself.
The boundaries among religions were also fluid because common believers had the freedom to choose and change their religions at will. In the Tang and Song, if the boundary between different religions existed, it mostly existed as a practical matter for priests. These priests had to compete for the support of the emperors, for numbers of converts, and for financial patronage. However, for a common believer, the boundary was not particularly important. An individual could participate in many different religious activities simultaneously. He could go to a Buddhist temple in the morning and offer sacrifice to a Taoist deity in the evening. She might worship Buddha and the Taoist deities side by side in her house. One chose a particular religion according to personal needs or taste.