Former Oakland A's right-hander Tim Hudson, 38, will get $23 million to spend next two seasons in San Francisco