If you are seeing the greyed out output volume when no headphones or plug is physically present than the physical switch to detect a plug missed the unplug event.
The system things you still have speakers connected and is routing the information to the jack.
Check for lint with a magnifying glass or very gently blow some clean compressed air. Service might be an option if this is something that happens very often.
Responding to the comments about this happening each time at reboot, that would indicate that the hardware is somehow saving headphones on as a default setting or the hardware is mis reading things at boot. Resetting NVRAM might help if it's a saved setting issue.
There are only 3 things in play here:
- The physical package in the jack that is responsible for sensing if anything is inserted and telling if it's a metal jack or an optical jack.
- The brains of the hardware - storing settings in NVRAM and turning the physical sensor into something the software can show you on the screen.
- The OS - Lion or Snow Leopard
I would be very surprised it's Lion related - but I've seen strange things before where software doesn't make the correct read on a sensor. It's good you can restore things temporarily by plugging / unplugging a jack. If you took it to a repair shop, they would hopefully test your mac with Snow Leopard again to rule out lion before doing an actual repair on the jack or the hardware. If this is something you can depend on - it happens each and every time, you might test by booting from a backup or installing Snow Leopard onto a USB drive and testing. It sure sounds like an odd but reproducible thing you have happening to your mac.