We introduce diagnostic expectations into a standard setting of price formation in which investors learn about the fundamental value of an asset and trade it. We study the interaction of diagnostic expectations with two well-known mechanisms: learning from prices and speculation (buying for resale). With diagnostic (but not with rational) expectations, these mechanisms lead to price paths exhibiting three phases: initial underreaction, followed by overshooting (the bubble), and finally a crash. With learning from prices, the model generates price extrapolation as a byproduct of fast moving beliefs about fundamentals, which lasts only as the bubble builds up. When investors speculate, even mild diagnostic distortions generate substantial bubbles.