The structural and electronic properties of the BxGa1−xN, BxAl1−xN, AlxGa1−xN and BxAlyGa1−x−yN compounds were studied using the full-potential linearized augmented plane wave method, within the generalized gradient approximation. We have compared the Al and B compositions dependence on the ground state properties: lattice parameters, bulk moduli and their pressure derivative, and band gap energies. The lattice parameters are found to change linearly for AlxGa1−xN, exhibit a downward bowing for both BxAl1−xN and BxGa1−xN, and has a very small deviation when Al is added and a large deviation when B is incorporated for BxAlyGa1−x−yN. The calculated band gap variation for the ternaries shows that the BxGa1−xN has a phase transition from direct-gap to indirect-gap for high boron contents (x > 0.75). As for BxAl1−xN, a direct-gap is found in the boron content range 0.07 < x < 0.83. For AlxGa1−xN and BxAlyGa1−x−yN compounds, they have been found to be direct-gap materials. The results show that the BxGa1−xN, BxAl1−xN, AlxGa1−xN and BxAlyGa1−x−yN materials may well be useful for optoelectronic applications.