3-way switches are the best solution here. Switch the bedside lamp on from the main switch by the door, and then off again from a second switch at the bedside. Many stairways are like this: you can control the lights from the switches at the bottom or the top of the stairs.