If you are creating a page display for the views, you can accomplish this with view's access controls. Views will show the first available display that the user has permissions to.
- Create a display for the authenticated user view
- Set the page path
- Set the Access restrictions (eg., by Authenticated role)
- Create a display for the anonymous user view
- Set the page path to the same value
- Optionally restrict access to the Anonymous role (not necessary, since if views can load the authenticated display for the user it will not bother with this one, but may keep it's use clear)
Since you cannot re-order the displays in a view (yet), you must define the views in the order of most restrictive to least restrictive.
For more complex displays, you can use the Panels Pages module to render the page differently based on a user's role.
If you only want to differentiate between anonymous and authenticated users, you can specify that different content blocks are visible to each role.
On my own site, I needed to differentiate between Administrators and everyone else, so I could not use the authenticated user role to define access for individual items. Similar to Views, with Panels Pages you can define multiple variants of pages that use the same path. Administrators have access to the first variant, and all other users fall through to using the second.