Depending on the length of the horizontal piece, a router might be the best tool. If the work piece is too long, it will be difficult to stand it on edge to run on a table saw (or router table for that matter). A handheld router has the advantage that you can lay the work piece down, and run the router along the edge of the work piece. Clamping the work piece vertically, then running the router along the edge, would also be an option.
Using a router to cut a groove in the end grain of a plank, could lead to chipping and terrible results. Depending on the width of the groove, and the species of wood. A router may not be an option.
You'll want to make a jig; or use a guide, as doing this freehand is not going to end well.
Depending on the application, biscuit; or possibly even dowel, joinery could be used.