The electronic and optical properties of zigzag and armchair β-graphyne nanotubes (β-GNTs) and their BN analogues (labeled as β-BNyne NTs) with different tube diameters are systematically investigated by the first-principles calculations. The calculated results reveal that all zigzag and armchair β-graphyne nanotubes are direct band gap semiconductors. As for zigzag β-BNyne NTs, they are wide direct band gap semiconductors. Nevertheless, armchair β-BNyne NTs are indirect band gap semiconductor. The optical spectra of β-GNTs and BNyne NTs show remarkable anisotropic behavior. Interestingly, the static dielectric constant of β-GNTs is quite high in comparison with carbon NTs, indicating higher conductivity and carrier mobility. In addition, quite broad frequency absorption spectra, extended from the infrared to the ultraviolet (UV) region, are observed for all β-GNTs. However, the photoresponse of β-BNyne NTs is mainly located in the UV region. The β-GNTs exhibit high reflectivity in the infrared region of 0.0 to 1.5 eV for both parallel and perpendicular polarization, but all β-BNyne NTs possess very low reflectivity and are highly sensitive to the UV light. Particularly, all β-GNTs demonstrate no obvious size-dependent optical properties, however, for β-BNyne NTs, all the photoresponse intensity (static dielectric constant, reflectivity and absorption coefficient) decreases monotonically with increasing tube size.