BH3 and BF3 violate the octet rule because other possible structures would lead to non-zero formal charges on the molecule (localized charges aren't stable), or boron doesnt have enough available atomic orbitals to form bonds (B has 2s and 3 2p orbitals, cant form 5 bonds). Boron will still form ions that obey the octet rule though, albiet with a net negative formal charge on the boron atom(i.e. BH4-, BF4-, B(OH)4-)
In the case of boron halides (BX3 where X=F, Cl, etc.) the electron deficiency of boron is counteracted by hyperconjugation. the lone pairs on the halogen "donates" some of the electron density to the empty p orbital on the Boron.
Another way to think of BH3 and BH3 is as an ionic compound with B3+ (like Al3+ in the same group), and H- or F- or whatever (which would obey the octet rule), and because of its high postive charge density, it "pulls on" the electron density from the nearby atoms, giving it some covalent character (this is why stuff like TiCl4 is covalent)
Also, as mentioned before BH3 and BF3 are good Lewis acids, and in the case of BH3, the pair of electrons in the B-H bond will "attack" the boron on another BH3 molecule, forming a dimer (B2H6), and creating this region of electron density spanning 3 atoms.This is called a 3-center 2-electron bond, or a banana bond. Coincidentally, some aluminum compounds (AlX3, where X=Cl, Br, CH3, etc) will also form dimers, but this is a bit different since the lone pair on X is what "attacks" the boron center, not the B-X bond, forming a 3-center 4-electron bond. but boron halides wont because of the hyperconjugation mentioned earlier.
You can also think of the 3-center/bridging bonds in terms of ionic resonance structures, if that helps.