returning #disabled in ajax callback
You can accomplish that using ajax_command_invoke.

Here is an example using your own code:

function ajax_example_autotextfields_callback($form, $form_state) {
  // $a = $form['first_name'];
  // $a['first_name']['#value'] = 'foobar';
  // $a['first_name']['#disabled'] = TRUE;
  // return $a;

  return array(
    '#type' =&gt; 'ajax',
    '#commands' =&gt; array(
      // First we add the disable attribute into the html input tag.
      // which makes the the input field inaccessible. 
      ajax_command_invoke('#WRAPPER_SELECTOR input', 'attr', array('disabled','disabled')),
      // Then we grey it out by adding the form-disabled CSS class.
      ajax_command_invoke('#WRAPPER_SELECTOR .form-item', 'addClass', array('form-disabled')),
    ),
  );
}


You can instead grey out using CSS attributes by calling ajax_command_css