debugging, fixing, and resolving a server error from an Ajax call is exactly the same process as any other request.
Check the web server error logs for any indications of what the error is
Introduce debug statements into the serverside code around where the error is occuring (and add a little bit to your ajax request to dump all the response as plain text)
It may also be useful to copy the URL and querystring used in the Ajax call and paste it into your browser to view any responses.
Firebug for Firefox is also a useful diagnostic tool for testing what is being sent as part of the Ajax call and what is being sent back as a response.