I want to render a scene but have the sun lamp not be effected by a certian object
If the ceiling is not a separate object, first separate it. You can do this by going into edit mode, selecting all the ceiling related vertices and pressing P. And from the popup menu, select 'selection'.
Once the ceiling is separated, select that ceiling object and go to material tab. If you find any number next to the material, it means the material is being used by more than one object (other than ceiling). Click on it so that a unique material is created for the ceiling.





Now, with ceiling selected, go to material node editor and change the node setup as shown below. In my case, my ceiling material is a diffuse shader. This node setup essentially makes the ceiling invisible for the sun lamp.