If you are in the country it is illegal to be without an entry clearance. If you are from a country that allows a waver (almost all English speaking ones and European qualify) then you get a 30 day clearance for tourist pruposes. If you have a visa you will get stamped at immigration on arrival at the aitport anywhere from 30 to 90 das depending on the Visa. If this entry permit expites, then you are illegal.
If you are couaght by the police (and the law says foreigners must carry their passpoerts at all times - and Thais must carry their ID cards) then you can go to jail. If you decide to go home then you will be fines for each day yopu noverstay (up to a maximum of 20,000 Baht). It really is not worth the expense or risk of overstaying the Visa/entry clearance - just go get a new once (extend it with a visa run etc).
Only a work permit allows you to legitimately work here. period. What I said earlier is that many teachers teach without work permits (or ones valid for the work they are doing - i.e. private or part time work). This means they are officially breaking the law. There is always a risk that there is a crack down (and Thailand really goes in for 2/3 day crackdowns on everything from time to time) then some may becaught and deported (once deported they are black marked and can never return - or are blocked for ten years etc).
Its a risk but many do it, with teaching it is somewhat ignored as may schools and agencies (like the police even!) can not afford the paperwork costs or legal requirements to get work permits for native (i.e. foreign) English speakers, bnut the risk is always there (even from a disgruntled Thai teacher who sees some backpacker getting 4 times the money with no degree or possibly even TEFL paperwork, a better air-con staff room (often Thai teachers have their own fan-cooled cramped staff rooms!) and allowed to go home when the lesson is over).
If you work without a WP, then it doesn't matter which Visa you have - because you're illegal anyway. Many teachers without WP's are passing through and only have tourist visas.
As I said some visas exclude the possibility of working at all (you can not get a work permit based on them) these include (for example): Non-Imm "ED", Non_Imm OA (Retirement visa), some types on Non-Imm "O" (they may be stamped 'work disallowed') and all Tourist Visas.
To get a 'B' Visa the embassy/consulate requires a letter as explained earlier from the employer offering a job. The company MUST fit the profile to allow it to hire (many things such as %Thai owned, capitalisation of company, time its been runing, taxes paid, amount of Thais to foreigners employed etc). The work MUST NOT be on the exclusion list (there is a large list of Thai only jobs such as working in a bar or farming for instance!). Once obtained, it does not allow you to work!!!! It allows your employer the right to apply for a workpermit (*a blue book). It is ONLY this that allows you to legally work.
You can own a business without a visa, as long as you do not work in it. For example I own a cafe here, I never work in it as I could never get a WP for it. This is fine - it allows Thais to be employed and earn money and pay taxes (well if they are paid enough - whcih they are not - I once saw a stat that said 80% of Thais never pay any income tax in their lives). The work permit thing is to protect Thai jobs, NOT to stop you earning money - that is why it also applies for unpaid work. There are plenty of gray areas (like working on the internet - or writing a book etc) that are probably best kept to ones self just in case.
When thew school hires a teacher - and applies (send the teacher top apply etc) for the work permit, they have toi complete a ton of paperwork. In that it should show that bthe person is suitably qualified (its down to the school these days to check that degrees are real etc - the MoEmay do it as a check if they feel a school is taking the mickey). If the teacher is not, then they need to justify his/her appointment. I know a guy who has a WP for teaching with no degree, but they waved it because he has two years worth of a degree and the school is in the sticks and can not recruit - the previso is he completes his degree at some point.
The fact that the friend has a B Visa does NOT give her the right to work - the labour department will expect the correct paperwork when her WP is appl;ied for, she may well come unstuck then. Some schools may tell you they have a WP in your name, but do not - so it is vital you ask for it (it is yours, not theirs and they have no legal right to keep it from you!).
The labour departments in different areas can have varying levels of stgrictness and laxness depending on many things (one is the availablility of teachers in the area, another may be their interpretation of the rules - which are often vague). SOme areas will accept a person with no paperwork, others will not.
good luck