Spot the Signs. According to Alison Green, who writes the blog Ask a Manager, this is common practice for some industries, especially if you're leaving to work for a direct competitor. However, in those situations, you'll likely know it's coming and can prepare accordingly.
Acceptance With Grace. The best_case scenario__and honestly, the most common reaction__is that your boss will accept your resignation with understanding and sincere congratulations. Your manager will be happy to see that you're advancing your career and moving on to something bigger and better.