My Apache error logs are showing the error "Premature end of script headers occurring" once in a while, and it seems that my site returns a 500 internal server error to the browser when it happens. The strange thing is, it will happen for a few minutes, then everything will return to normal.
The Apache Wiki has a good section on this error listing the most common cause: scripts which fail to properly output the HTTP header. It sounds like a script is occasionally crashing or timing out before it outputs and flushes the header which appears to you as the "Premature end of script headers"/500 error.
If possible, trying testing the script locally to make sure that it is correctly outputting the headers under all conditions.
If you're using mod_fcgid or fastcgi in general, you may have a mismatch between the number of children and/or requests apache is configured to use each fastcgi process for, and the number of children and/or requests php-cgi is using. Are you setting up the fastcgi environment variables in apache's configuration file, or are you using a wrapper script to set PHP_FCGI_CHILDREN (must be disabled with fcgid) and PHP_FCGI_MAX_REQUESTS?
If apache's configuration and PHP's environment variable settings don't match, then if PHP decides it's reached MAX_REQUESTS before apache decides it has, PHP will exit but apache will still think it's accepting requests.
You can read more about this and an example wrapper script and proper fcgid configuration here.