Joomla 1.6/7/ and 2.5 brings the capability for that. Ok, here is how to get this done,

  1. Create a new group in Users | Groups. Name it GUESTS. Select Parent Group as PUBLIC
  2. Goto Users | Options  and selec the Component tab. Select GUEST as the "Guest User Group" there.
  3. Create a new ACL in Users | Acces Levels named GUEST USERS.
  4. Edit GUESTS USERS ACL, which you just created and select GUESTS group to it. Dont add PUBLIC group to it.
  5. Edit PUBLIC ACL and add GUEST USERS ACL to it.
  6. Now you are done with the group and access level creation. Now goto Global Configuration and select DEFAULT ACCESS LEVEL as GUEST USERS.
  7. Now, you are ready to go. Make any menu item or module to test. Just select , Access as GUEST USER in that item and test on frontend. You can see that menu item/module when you are not logged in. And as soon as you login, that menu item/module will be hidden.