Based on the listed companies of Shanghai Stock Exchange in 2008-2015, this paper uses the absolute value of residual value of the company's capital expenditure, acquisition expenditure and ROA volatility as the proxy variable to measure the optimal risk level, and the reports of the company's social responsibility from RunLing to measure the corporate social responsibility. This paper studies the impact of corporate social responsibility on the risk taking and the firm value. The study finds that corporate social responsibility is an effective mechanism to reduce the deviation of the company from the optimal risk level; corporate social responsibility is a way to increase the value of the company. However, the result of interaction effect of corporate social responsibility and risk taking on firm value shows that the corporate social responsibility does not affect the firm value further through the risk taking. After a variety of robustness tests, the above conclusions remain essentially unchanged. The results of this paper show that the importance of corporate social responsibility for the securities market regulation, the operation of listed companies and investors, and corporate social responsibility also has a great value for reference.