Short answer: only a straight flush beats four aces: five consecutive cards of the same suit. Its highest form is the royal flush. Every other hand loses to four aces.
Why only a straight flush?
Four of a kind, "quads" in poker slang, is the second-highest hand category in poker. Only the straight flush ranks above it, and four aces are the highest quads there are. They cannot lose to a full house, a flush, a straight or anything below.
In Texas Hold'em all players share the same five community cards. That is why one single card can complete two hands at once: one player's quads and another player's straight flush. The setup is so rare that most players spend a lifetime at the table without ever seeing it.
The most famous hand: Mabuchi vs. Phillips
Main Event of the 2008 World Series of Poker in Las Vegas, the ESPN cameras are rolling. Motoyuki Mabuchi is dealt A♣ and A♠. The flop comes A♥, 9♣ and Q♦: a set of aces, a flop can hardly come out better. Across from him sits Justin Phillips with K♦ and J♦, holding nothing but a gutshot straight draw.
The turn is the 10♦. And then the river: A♦.
The same card completes both hands. Phillips makes the royal flush, Mabuchi improves from a set to four aces. The river makes Mabuchi ready to pay off everything at the exact moment he can no longer win. Mabuchi bets, Phillips raises, Mabuchi says "gamble" and calls.
Commentator Lon McEachern summed it up in one sentence: you flop a set of aces, you make quads on the river, and you lose. The broadcast put the odds of this matchup at roughly 1 in 2.7 billion.
Four aces used to be unbeatable
That any hand can beat four aces at all is a 19th-century invention. The first documented poker deck had only twenty cards: ten, jack, queen, king and ace. Four players got five cards each, and straights and flushes did not exist. The rankings ended at four of a kind, so four aces could never lose.
Somewhere between 1830 and 1850 the missing 32 cards were added. The full deck brought new hands: the flush caught on quickly, and the straight first appeared in a rulebook in 1864.
The straight flush, on the other hand, owes its existence to a moral argument. In the 19th century it was considered bad form to bet money on an absolute certainty like four aces. In the draw poker of the time, two players can hold a royal flush simultaneously, in different suits, while four aces exist only once in the deck. So the straight flush dethroned four aces, and to this day it is the only hand that can.
How rare is a royal flush anyway?
Even without four aces on the other side, a royal flush is a rarity: in Texas Hold'em the odds are about 1 in 30,940. The full math is in What are the odds of a royal flush?
Sources in the book: PokerNews on the 2008 WSOP hand; David Parlett, "History of Poker" and "Poker: a brief history", on the twenty-card game and the introduction of the straight and straight flush.