Optical coherence tomography (OCT) has gained wide adoption in biological research and medical imaging due to its exceptional tissue penetration, 3D imaging speed, and rich contrast. However, OCT plays a relatively small role in molecular and cellular imaging due to the lack of suitable biomolecular contrast agents. In particular, while the green fluorescent protein has provided revolutionary capabilities to fluorescence microscopy by connecting it to cellular functions such as gene expression, no equivalent reporter gene is currently available for OCT. Here, we introduce gas vesicles, a class of naturally evolved gas-filled protein nanostructures, as genetically encodable OCT contrast agents. The differential refractive index of their gas compartments relative to surrounding aqueous tissue and their nanoscale motion enables gas vesicles to be detected by static and dynamic OCT. Furthermore, the OCT contrast of gas vesicles can be selectively erased in situ with ultrasound, allowing unambiguous assignment of their location. In addition, gas vesicle clustering modulates their temporal signal, enabling the design of dynamic biosensors. We demonstrate the use of gas vesicles as reporter genes in bacterial colonies and as purified contrast agents in vivo in the mouse retina. Our results expand the utility of OCT to image a wider variety of cellular and molecular processes