They're both beautiful, fascinating cities, but in different ways.
Prague is on the whole much older. The castle, Old Town, the Charles Bridge, the Jewish quarter - all are medieval and very much look like you would expect an enchanted, magical land to look in fairy tales. There's also a lot of cool, more modern architecture - particularly Art Nouveau (ex. the Municipal House). Plus the 70s-style Soviet subway is way cool.
Budapest is old as well, but its heyday was in the 19th century, so it feels much more modern. I'd describe it as a more muscular beauty. One thing Budapest has going for it over Prague, quite frankly, is the food. Hungarian food - it's not light; it's not particularly healthy; but it's gooooooooood! ^^^
Frankly, I'd suggest hitting both cities if you have the time. They're both wonderful places to visit, and the contrasts between the two make you appreciate them both more.