Carter faced off against Ted Kennedy ( the youngest sibling of President John F. Kennedy ) for the Democratic nomination , and Carter defeated Kennedy in 24 out of 34 primaries , returning his name to the ballot .