Maybe you forgot to complete a key part of an important project, or to submit a crucial report on time. 'Fessing up to your boss is the honorable — and smart — thing to do.
The key is to make the solution as complete as possible, so that the boss can tell you saw a problem, looked into how to solve it, and came up with a solution on your own.