Dealing with Missing Data when Testing the CAPM
Easiest fix: if you're worried about it you should value weight your results. This is suggest by, for instance, Kothari, Shanken and Sloan (1995). Firms that are delisted tend to have extremely small market cap, so value weighting gives them very little impact on summary statistics. Delisted returns should also be used, although I'm not sure how much impact they'll have. I've seen the delisted return stuck into the month after a stock ceases to be traded.

In finding $\beta$'s, I tend to see the regression used only on those dates for which the stock return is observed. The correction really comes in value weighting summary statistics afterwards. Whether all this is "correct" or just the practice I've seen is not something I'm sure about.

Edit: here's a different perspective.