I see some place reference the S&P 500 index (SPY) as the risk-free rate and other place reference the 10-year Treasury yield as the risk-free rate. Which one is the correct one?
I assume you want to use CAPM that ralates e.g. a single stock to "the market" (often take to be the S&P500). In this model you need a "risk free rate". I think you do not make a mistake if you take government bonds as the risk free rate. But do not simply use 10Y. The maturity should depend on the time index t in the Security Characteristic Line. If it is a quarterly index use the 3M government bond rate.
See this link for the equation I am refering to: