Lighthouse beams are often perceived as bent rather than straight, and observers sometimes infer that a rotating lighthouse beam originates from a ``phantom lighthouse'' that lies in the opposite direction from the true source of the beam. We argue that both illusions arise as a result of Bayesian inference based on natural scene statistics and support our argument by implementing a formal computational model. In addition to capturing both illusions, our model makes the novel predictions that a beam viewed from the side is perceived to bend towards the observer, and that the phantom lighthouse illusion should only emerge at a critical point at which the observer is located around 75 metres in front of the true source of a rotating lighthouse beam. Our theory therefore motivates a future line of experimental work, and contributes to a broader body of research that explains perceptual phenomena (including visual illusions) in terms of Bayesian inference.