The Geometry node Normal can be used to control the profile of the light emitted by a lamp and this can be used with an image texture to give full control of the lamp output.
Consider the following nodes :
Here the Geometry Normal is passed through a Mapping node to rotate it into the desired direction before being split into its X,Y,Z components. The X and Y components are adjusted to remove the 'bending' caused by the spherical Normal coordinates (otherwise you get distortion of the image at the corners) before being passed through a second Mapping node (to adjust the aspect ratio of the image) before being passed to the Image node for the texture - simply apply your own image in the Image node.
This can produce the following result :
Replace the Image with an image of a plain square - or any other shape - for your desired result.
This method will work with the Point and Spot lamp types - but the Spot will also be limited to a circular spot (in the direction of the lamp) so the Point lamp gives more control since you can simply provide whatever image you desire. Note also that the Lamp includes a 'Size' setting - setting to affect the blurriness of the lamp - setting this to zero will produce a very sharp image (as in the above example). Setting it to larger values will produce progressively blurier projections.