People will have questions, and there may be confidential information that cannot be disclosed. But whenever possible, management needs to be forthright so as not to incite panic or speculation. Once the word is out to managers, it should be communicated to the rest of the company quickly, ideally that same day. The more time that passes, and the more people who know, the more likely it will leak. Every person who knows is a liability when you're trying to keep a secret.
Some companies have a specified plan for how to deal with a departing executive.
There are scenarios for when someone is asked to leave as well as for when a senior official resigns voluntarily. This type of plan can be a lifesaver when the departure happens without much notice. Just because an executive is leaving does not mean it's a negative situation. Plenty of top-level people do in fact leave to pursue other opportunities, and the resignation is not related to the stability of the business. But remember, once the rumor mill starts spinning, regardless of the circumstances, it's harder to put a stop to it than it would have been to prevent it by being honest from the start.