CDROM Opens and Closes Automatically?
We can probably start by ruling out possession, at least the kind that might require an exorcist. I've heard reports of this happening due to a hardware problem, specifically with the drive tray being out of alignment, or due to the lens inside the drive being damaged or dirty. It's also possible to control the drive door with software, so perhaps rogue software is to blame.
You can diagnose the problem a couple of different ways. If you happen to have a spare CDROM drive, or you can borrow one from another computer, swap out the drive and see if the problem continues. (It might sound like a daunting task, but replacing a CDROM drive isn't hard at all. Typically they are held in place by a couple of screws, and connected with two cables.) If the problem goes away after swapping drives, you can safely assume it was a defective drive. Since CDROM drives can be purchased for less than $20, it's probably a waste of time and money to attempt a repair. You can try a CDROM lens cleaner if you're intent on trying to revive the drive.
If you continue to see the mysterious behavior after swapping drives, don't call the ghost busters yet. I've read reports that a faulty USB device could cause the drive door to open unexpectedly. One Macintosh user found that piles of paper near the keyboard sometimes accidentally hit the eject key. Yet another Mac user suggested resetting the PMU as a possible fix. I don't use a Mac, and I have no idea what a PMU is, so your mileage may vary.
Blame The Software
If you don't want to fiddle with the guts of your computer, look for a software cause first. Is it possible that someone installed some "joke" software without your knowledge? Such programs do exist, and can cause the cdrom tray to open and close by itself at random times. Another possibility is a virus, spyware or some other bit of malware that's designed to play tricks on you. I've seen reports by users who had exactly this problem, and solved it with a thorough spyware cleanup.
Read Secure Your Computer to see my recommendations for the best anti-virus and anti-spyware software, and the facts on both hardware & software firewalls. This is the security solution I've used myself for several years and it works great for me. Best of all, everything you need is free!
Have you encountered this problem? Tell us how you solve it, by posting your comments below.